The cmake logic to find cuda paths exposes some paths to search for the cuda
library, we need to propagate this through the call for find_library.
This was already done for cuSparse but not for cuda.
Differential Revision: https://reviews.llvm.org/D151645
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)
- find_library(CUDA_DRIVER_LIBRARY cuda)
-
+ find_library(CUDA_DRIVER_LIBRARY cuda HINTS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
target_link_libraries(MLIRGPUTransforms
PRIVATE
MLIRNVVMToLLVMIRTranslation
endif()
# We need the libcuda.so library.
- find_library(CUDA_RUNTIME_LIBRARY cuda)
+ find_library(CUDA_RUNTIME_LIBRARY cuda HINTS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
# We need the libcusparse.so library.
- find_library(CUDA_CUSPARSE_LIBRARY cusparse HINTS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+ find_library(CUDA_CUSPARSE_LIBRARY cusparse HINTS ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES} REQUIRED)
add_mlir_library(mlir_cuda_runtime
SHARED