ROCm / rpp

AMD ROCm Performance Primitives (RPP) library is a comprehensive high-performance computer vision library for AMD processors with HIP/OpenCL/CPU back-ends.
https://rocm.docs.amd.com/projects/rpp/en/latest/
MIT License
53 stars 38 forks source link

Improve finding half.hpp #413

Open trixirt opened 1 month ago

trixirt commented 1 month ago

On Fedora half.hpp is installed to the system dir /usr/include. There is no cmake package, so finding the half cmake package will always fail. The source looks for half with #include <half/half.h> The use of half/ makes it impossible to find and use the system location.

So look for the half.hpp path and add add that to the include_directories.

Use this sed script to programatically change the uses of #include <half/half.h>

for f in find . -type f -name '*.hpp' -o -name '*.cpp'; do sed -i -e 's@#include <half/half.hpp>@#include @' $f done

This covers this issue https://github.com/ROCm/rpp/issues/292

kiritigowda commented 1 month ago

@trixirt -- changes failing all CI builds

CMake Error in src/modules/CMakeLists.txt:
  Found relative path while evaluating include directories of "modules":

    "HALF_INCLUDE_DIR-NOTFOUND"

CMake Error in addkernels/CMakeLists.txt:
  Found relative path while evaluating include directories of "addkernels":

    "HALF_INCLUDE_DIR-NOTFOUND"

-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    HALF_INCLUDE_DIRS

CMake Generate step failed.  Build files cannot be regenerated correctly.

##[error]The process '/usr/local/bin/cmake' failed with exit code 1
##[error]CMake failed with error: The process '/usr/local/bin/cmake' failed with exit code 1