@@ -6,6 +6,10 @@ file(GLOB test_srcs
6
6
7
7
# These tests always build with RDC, so make sure that the sm_XX flags are
8
8
# 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.
9
13
set (CMAKE_CUDA_FLAGS "${THRUST_CUDA_FLAGS_BASE} ${THRUST_CUDA_FLAGS_RDC} " )
10
14
11
15
foreach (thrust_target IN LISTS THRUST_TARGETS)
@@ -18,11 +22,11 @@ foreach(thrust_target IN LISTS THRUST_TARGETS)
18
22
get_filename_component (test_name "${test_src} " NAME_WLE)
19
23
string (PREPEND test_name "cuda." )
20
24
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 } )
27
31
endforeach ()
28
32
endforeach ()
0 commit comments