diff --git a/CMakeLists.txt b/CMakeLists.txt index 53cfeee189..6f29d74f18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -326,7 +326,11 @@ if(USE_CUDA) # ${ABACUS_BIN_NAME} is added before CUDA is enabled set_property(TARGET ${ABACUS_BIN_NAME} PROPERTY CUDA_ARCHITECTURES ${CMAKE_CUDA_ARCHITECTURES}) - target_link_libraries(${ABACUS_BIN_NAME} cudart nvToolsExt) + if (CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.9) + target_link_libraries(${ABACUS_BIN_NAME} cudart) + else () + target_link_libraries(${ABACUS_BIN_NAME} cudart nvToolsExt) + endif () include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) if(USE_CUDA) add_compile_definitions(__CUDA) diff --git a/source/module_hsolver/kernels/cuda/diag_cusolver.cuh b/source/module_hsolver/kernels/cuda/diag_cusolver.cuh index 557cf9c3bd..faf4ec0a09 100644 --- a/source/module_hsolver/kernels/cuda/diag_cusolver.cuh +++ b/source/module_hsolver/kernels/cuda/diag_cusolver.cuh @@ -1,8 +1,14 @@ #ifndef DIAG_CUSOLVER_CUH #define DIAG_CUSOLVER_CUH - +#include #include + +#if CUDA_VERSION < 12090 #include "nvToolsExt.h" +#else +#include "nvtx3/nvToolsExt.h" +#endif + #include #include