mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Created the new EIGEN_TEST_CUDA_CLANG option to compile the CUDA tests using clang instead of nvcc
This commit is contained in:
@@ -19,10 +19,25 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
endif()
|
||||
|
||||
if(EIGEN_ADD_TEST_FILENAME_EXTENSION STREQUAL cu)
|
||||
if (${ARGC} GREATER 2)
|
||||
cuda_add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
|
||||
if(EIGEN_TEST_CUDA_CLANG)
|
||||
set_source_files_properties(${filename} PROPERTIES LANGUAGE CXX)
|
||||
if(CUDA_64_BIT_DEVICE_CODE)
|
||||
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib64")
|
||||
else()
|
||||
link_directories("${CUDA_TOOLKIT_ROOT_DIR}/lib")
|
||||
endif()
|
||||
if (${ARGC} GREATER 2)
|
||||
add_executable(${targetname} ${filename})
|
||||
else()
|
||||
add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
|
||||
endif()
|
||||
target_link_libraries(${targetname} "cudart_static" "cuda" "dl" "rt" "pthread")
|
||||
else()
|
||||
cuda_add_executable(${targetname} ${filename})
|
||||
if (${ARGC} GREATER 2)
|
||||
cuda_add_executable(${targetname} ${filename} OPTIONS ${ARGV2})
|
||||
else()
|
||||
cuda_add_executable(${targetname} ${filename})
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
add_executable(${targetname} ${filename})
|
||||
@@ -316,7 +331,11 @@ macro(ei_testing_print_summary)
|
||||
endif()
|
||||
|
||||
if(EIGEN_TEST_CUDA)
|
||||
message(STATUS "CUDA: ON")
|
||||
if(EIGEN_TEST_CUDA_CLANG)
|
||||
message(STATUS "CUDA: ON (using clang)")
|
||||
else()
|
||||
message(STATUS "CUDA: ON (using nvcc)")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "CUDA: OFF")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user