Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit 7cd68d9

Browse files
committed
Add testing for CDP seq fallbacks when RDC is disabled.
1 parent c2d5261 commit 7cd68d9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

testing/cuda/CMakeLists.txt

+10-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ file(GLOB test_srcs
66

77
# These tests always build with RDC, so make sure that the sm_XX flags are
88
# compatible. See note in ThrustCudaConfig.cmake.
9+
# TODO once we're using CUDA_ARCHITECTURES, we can setup non-rdc fallback
10+
# tests to build for non-rdc arches. But for now, all files in a given directory
11+
# must build with the same `CMAKE_CUDA_FLAGS` due to CMake constraints around
12+
# how CUDA_FLAGS works.
913
set(CMAKE_CUDA_FLAGS "${THRUST_CUDA_FLAGS_BASE} ${THRUST_CUDA_FLAGS_RDC}")
1014

1115
foreach(thrust_target IN LISTS THRUST_TARGETS)
@@ -18,11 +22,11 @@ foreach(thrust_target IN LISTS THRUST_TARGETS)
1822
get_filename_component(test_name "${test_src}" NAME_WLE)
1923
string(PREPEND test_name "cuda.")
2024

21-
thrust_add_test(test_target ${test_name} "${test_src}" ${thrust_target})
22-
23-
# All in testing/cuda will test device-side launch (aka calling parallel
24-
# algorithms from device code), which requires the CUDA device-side runtime,
25-
# which requires RDC, so these always need to be built with RDC.
26-
thrust_enable_rdc_for_cuda_target(${test_target})
25+
# Create two targets, one with RDC enabled, the other without. This tests
26+
# both device-side behaviors -- the CDP kernel launch with RDC, and the
27+
# serial fallback path without RDC.
28+
thrust_add_test(seq_test_target ${test_name}.cdp_0 "${test_src}" ${thrust_target})
29+
thrust_add_test(cdp_test_target ${test_name}.cdp_1 "${test_src}" ${thrust_target})
30+
thrust_enable_rdc_for_cuda_target(${cdp_test_target})
2731
endforeach()
2832
endforeach()

0 commit comments

Comments
 (0)