File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -524,10 +524,21 @@ function(MFC_SETUP_TARGET)
524524 target_compile_options (${a_target} PRIVATE "SHELL:-h noacc" "SHELL:-x acc" )
525525 endif ()
526526
527- if (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC" OR CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
528- find_package (CUDAToolkit REQUIRED)
529- target_link_libraries (${a_target} PRIVATE CUDA::nvToolsExt)
527+ if (CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC" OR
528+ CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
529+
530+ # Ask specifically for the header-only NVTX v3 interface
531+ find_package (CUDAToolkit REQUIRED COMPONENTS nvtx3)
532+
533+ if (TARGET CUDA::nvToolsExt) # CUDA <= 12.8
534+ target_link_libraries (${a_target} PRIVATE CUDA::nvToolsExt)
535+ else () # CUDA >= 12.9
536+ target_link_libraries (${a_target} PRIVATE CUDA::nvtx3)
537+ endif ()
538+ target_link_options (${a_target} PRIVATE "-cudalib=nvtx" )
539+
530540 endif ()
541+
531542 endforeach ()
532543
533544 install (TARGETS ${ARGS_TARGET} RUNTIME DESTINATION bin)
You can’t perform that action at this time.
0 commit comments