mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-07 18:27:40 +08:00
Add buildtests_gpu and check_gpu to simplify GPU testing.
This is in preparation of adding GPU tests to the CI, allowing us to limit building/testing of GPU-specific tests for a given GPU-capable runner. GPU tests are tagged with the label "gpu". The new targets ``` make buildtests_gpu make check_gpu ``` allow building and running only the gpu tests.
This commit is contained in:
parent
1239adfcab
commit
16f9a20a6f
@ -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)
|
||||
|
||||
|
@ -23,7 +23,9 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
set(EIGEN_SUBTESTS_LIST "${EIGEN_SUBTESTS_LIST}${targetname}\n")
|
||||
set_property(GLOBAL PROPERTY EIGEN_SUBTESTS_LIST "${EIGEN_SUBTESTS_LIST}")
|
||||
|
||||
set(is_gpu_test OFF)
|
||||
if(EIGEN_ADD_TEST_FILENAME_EXTENSION STREQUAL cu)
|
||||
set(is_gpu_test ON)
|
||||
if(EIGEN_TEST_HIP)
|
||||
hip_reset_flags()
|
||||
hip_add_executable(${targetname} ${filename} HIPCC_OPTIONS "-DEIGEN_USE_HIP ${ARGV2}")
|
||||
@ -57,10 +59,10 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
add_executable(${targetname} ${filename})
|
||||
endif()
|
||||
|
||||
if (targetname MATCHES "^eigen2_")
|
||||
add_dependencies(eigen2_buildtests ${targetname})
|
||||
else()
|
||||
add_dependencies(buildtests ${targetname})
|
||||
add_dependencies(buildtests ${targetname})
|
||||
|
||||
if (is_gpu_test)
|
||||
add_dependencies(buildtests_gpu ${targetname})
|
||||
endif()
|
||||
|
||||
if(EIGEN_NO_ASSERTION_CHECKING)
|
||||
@ -118,6 +120,11 @@ macro(ei_add_test_internal testname testname_with_suffix)
|
||||
add_dependencies("Build${current_subproject}" ${targetname})
|
||||
set_property(TEST ${testname_with_suffix} PROPERTY LABELS "${current_subproject}")
|
||||
endif()
|
||||
if (is_gpu_test)
|
||||
# Add gpu tag for testing only GPU tests.
|
||||
set_property(TEST ${testname_with_suffix} APPEND PROPERTY LABELS "gpu")
|
||||
endif()
|
||||
|
||||
if(EIGEN_SYCL)
|
||||
# Force include of the SYCL file at the end to avoid errors.
|
||||
set_property(TARGET ${targetname} PROPERTY COMPUTECPP_INCLUDE_AFTER 1)
|
||||
@ -775,8 +782,7 @@ macro(ei_add_smoke_tests smoke_test_list)
|
||||
if ("${test}" IN_LIST EIGEN_SUBTESTS_LIST)
|
||||
add_dependencies("${buildtarget}" "${test}")
|
||||
# Add label smoketest to be able to run smoketests using ctest
|
||||
get_property(test_labels TEST ${test} PROPERTY LABELS)
|
||||
set_property(TEST ${test} PROPERTY LABELS "${test_labels};smoketest")
|
||||
set_property(TEST ${test} APPEND PROPERTY LABELS "smoketest")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro(ei_add_smoke_tests)
|
||||
|
Loading…
Reference in New Issue
Block a user