CHIP-SPV / chipStar

chipStar is a tool for compiling and running HIP/CUDA on SPIR-V via OpenCL or Level Zero APIs.
Other
182 stars 29 forks source link

error: use of undeclared identifier 'FLT_EPSILON' Compiling chipStar with oneapi from an Anaconda install results in compilation error #759

Closed pvelesko closed 3 months ago

pvelesko commented 7 months ago

During compilation we seem to be picking up float.h from Intel LLVM include dir as opposed to clang we use for compiling. This results in some undefined macros for MAX/MIX size types.

[ 63%] Building CXX object samples/0_MatrixMultiply/CMakeFiles/MatrixMultiply.dir/MatrixMultiply.cpp.o
/home/pvelesko/space/chipStar/fix-icpx-include/samples/0_MatrixMultiply/MatrixMultiply.cpp:317:15: error: use of undeclared identifier 'FLT_EPSILON'
  317 |   float eps = FLT_EPSILON * 4;

Workaround:

╰─$ sudo mv /space/pvelesko/install/oneapi/compiler/2024.0.0/include/float.h /space/pvelesko/install/oneapi/compiler/2024.0.0/include/float.h_backup