Skip to content

Commit

Permalink
[CUDA] fix include paths to CUDA math libs
Browse files Browse the repository at this point in the history
  • Loading branch information
abagusetty committed Oct 21, 2024
1 parent 4a88054 commit 8ae46f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Nwpw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if (NWPW_CUDA)
find_package(NVHPC REQUIRED COMPONENTS CUDA MATH NVSHMEM NCCL MPI)
else()
enable_language(CUDA)
find_package(CUDAToolkit REQUIRED)
find_package(CUDAToolkit REQUIRED COMPONENTS cublas cusolver cufft)
message("-- Using cublas : " ${CUDA_cublas_LIBRARY})
message("-- Using cusolver: " ${CUDA_cusolver_LIBRARY})
message("-- Using cufft : " ${CUDA_cufft_LIBRARY})
Expand Down Expand Up @@ -227,12 +227,12 @@ endif()

if(OpenCL_FOUND)
target_link_libraries(pwdft band pspw file nwpwlib ${MPI_LIBRARIES} ${OpenCL_LIBRARY})
elseif(NWPW_CUDA)
target_include_directories(pwdft PUBLIC ${CUDAToolkit_INCLUDE_DIRS})
elseif(NWPW_CUDA)
target_include_directories(pwdft PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES} ${CUDAToolkit_INCLUDE_DIRS})
if(CMAKE_CXX_COMPILER_ID MATCHES "NVHPC")
target_link_libraries(pwdft band pspw file nwpwlib ${MPI_LIBRARIES} NVHPC::CUDART NVHPC::CUBLAS NVHPC::CUSOLVER NVHPC::CUFFT)
target_link_libraries(pwdft PRIVATE band pspw file nwpwlib ${MPI_LIBRARIES} NVHPC::CUDART NVHPC::CUBLAS NVHPC::CUSOLVER NVHPC::CUFFT)
else()
target_link_libraries(pwdft band pspw file nwpwlib ${MPI_LIBRARIES} CUDA::cudart CUDA::cublas CUDA::cusolver CUDA::cufft)
target_link_libraries(pwdft PRIVATE band pspw file nwpwlib ${MPI_LIBRARIES} CUDA::cudart CUDA::cublas CUDA::cusolver CUDA::cufft)
endif()
elseif(NWPW_HIP)
target_include_directories(pwdft PUBLIC ${ROCBLAS_INCLUDE_DIRS} ${ROCFFT_INCLUDE_DIRS} ${ROCSOLVER_INCLUDE_DIRS})
Expand Down

0 comments on commit 8ae46f9

Please sign in to comment.