Fix cuda device warnings

This commit is contained in:
Antonio Sanchez
2025-02-28 15:21:23 -08:00
parent c53002f5fb
commit 23b1682723
53 changed files with 655 additions and 600 deletions

View File

@@ -1,7 +1,7 @@
include(EigenTesting)
include(CheckCXXSourceCompiles)
# configure the "site" and "buildname"
# configure the "site" and "buildname"
ei_set_sitename()
# retrieve and store the build string
@@ -11,6 +11,15 @@ add_custom_target(buildtests)
add_custom_target(check COMMAND "ctest")
add_dependencies(check buildtests)
# Convenience target for only building GPU tests.
add_custom_target(buildtests_gpu)
add_custom_target(check_gpu COMMAND "ctest" "--output-on-failure"
"--no-compress-output"
"--build-no-clean"
"-T" "test"
"-L" "gpu")
add_dependencies(check_gpu buildtests_gpu)
# check whether /bin/bash exists (disabled as not used anymore)
# find_file(EIGEN_BIN_BASH_EXISTS "/bin/bash" PATHS "/" NO_DEFAULT_PATH)
@@ -50,7 +59,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CTEST_CUSTOM_COVERAGE_EXCLUDE "/test/")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS}")
endif(EIGEN_COVERAGE_TESTING)
elseif(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS")
endif(CMAKE_COMPILER_IS_GNUCXX)

View File

@@ -18,7 +18,9 @@ macro(ei_add_test_internal testname testname_with_suffix)
set(filename ${testname}.cpp)
endif()
set(is_gpu_test OFF)
if(EIGEN_ADD_TEST_FILENAME_EXTENSION STREQUAL cu)
set(is_gpu_test ON)
if(EIGEN_TEST_CUDA_CLANG)
set_source_files_properties(${filename} PROPERTIES LANGUAGE CXX)
if(CUDA_64_BIT_DEVICE_CODE)
@@ -48,6 +50,9 @@ macro(ei_add_test_internal testname testname_with_suffix)
else()
add_dependencies(buildtests ${targetname})
endif()
if (is_gpu_test)
add_dependencies(buildtests_gpu ${targetname})
endif()
if(EIGEN_NO_ASSERTION_CHECKING)
ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_NO_ASSERTION_CHECKING=1")
@@ -98,6 +103,10 @@ macro(ei_add_test_internal testname testname_with_suffix)
endif()
add_test(${testname_with_suffix} "${targetname}")
if (is_gpu_test)
# Add gpu tag for testing only GPU tests.
set_property(TEST ${testname_with_suffix} APPEND PROPERTY LABELS "gpu")
endif()
# Specify target and test labels accoirding to EIGEN_CURRENT_SUBPROJECT
get_property(current_subproject GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT)