Closed Mogball closed 4 years ago
Did you set CUDA_BACKEND_ENABLED to true in ccmake?
If yes cmake should run enable_language(CUDA) which should be sufficient to get the right include paths.
CUDA_BACKEND_ENABLED
is enabled by default, but enabling it explicitly didn't append the include path. Maybe the cmake version affects its behaviour. I'm on 3.18.1
.
Interesting! Maybe CUDA is in the default include path on ubuntu (all our machines use ubuntu)
out of curiosity does it work for you to add the path /lib/Conversion/LoopsToGPU/CMakeLists.txt:
add_mlir_dialect_library(GPUToKernelAndRuntimeCalls
ConvertKernelFuncToCubin.cpp
ConvertKernelFuncToHsaco.cpp
ADDITIONAL_HEADER_DIRS
${PROJECT_SOURCE_DIR}/include/Conversion/LoopsToGPU
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
I have a slight preference for this solution. If it doesn't work I will add the path to the global cmakelists as you suggested.
Yeah this works. Thanks!
Thanks for reporting this! Should be fixed in the master.
The include
https://github.com/spcl/open-earth-compiler/blob/0303e0ec4c8476b667da84186aee1f4ac1fa7e6f/lib/Conversion/LoopsToGPU/ConvertKernelFuncToCubin.cpp#L15
Complains that
cuda.h
cannot be found. I had to addTo the top-level
CMakeLists.txt
. I'm not sure this is the proper fix but I was able to compile with it.