Add CUDA CI jobs with NVHPC (nvc++) as host and device compiler

libeigen/eigen!2204

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
Rasmus Munk Larsen
2026-02-24 16:54:08 -08:00
parent 2cd9bb7380
commit fa567f6bcd
4 changed files with 58 additions and 9 deletions

View File

@@ -46,6 +46,21 @@ macro(ei_add_test_internal testname testname_with_suffix)
set(CUDA_CLANG_LINK_LIBRARIES ${CUDA_CLANG_LINK_LIBRARIES} "rt")
endif()
target_link_libraries(${targetname} ${CUDA_CLANG_LINK_LIBRARIES})
elseif(EIGEN_TEST_CUDA_NVC)
set_source_files_properties(${filename} PROPERTIES LANGUAGE CXX)
if(CUDA_64_BIT_DEVICE_CODE AND (EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/lib64"))
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
else()
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib")
endif()
add_executable(${targetname} ${filename})
set(CUDA_NVC_LINK_LIBRARIES "cudart_static" "cuda" "dl" "pthread")
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND CUDA_NVC_LINK_LIBRARIES "rt")
endif()
target_link_libraries(${targetname} ${CUDA_NVC_LINK_LIBRARIES})
else()
cuda_add_executable(${targetname} ${filename})
endif()