@@ -6,6 +6,9 @@ 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 have 3.18 as the minimum version, 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`.
9
12
set (CMAKE_CUDA_FLAGS "${THRUST_CUDA_FLAGS_BASE} ${THRUST_CUDA_FLAGS_RDC} " )
10
13
11
14
foreach (thrust_target IN LISTS THRUST_TARGETS)
@@ -18,11 +21,11 @@ foreach(thrust_target IN LISTS THRUST_TARGETS)
18
21
get_filename_component (test_name "${test_src} " NAME_WLE)
19
22
string (PREPEND test_name "cuda." )
20
23
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 } )
24
+ # Create two targets, one with RDC enabled, the other without. This tests
25
+ # both device-side behaviors -- the CDP kernel launch with RDC, and the
26
+ # serial fallback path without RDC.
27
+ thrust_add_test(fb_test_target ${test_name} .fallback " ${test_src} " ${thrust_target} )
28
+ thrust_add_test(cdp_test_target ${test_name} .cdp " ${test_src} " ${thrust_target} )
29
+ thrust_enable_rdc_for_cuda_target(${cdp_test_target } )
27
30
endforeach ()
28
31
endforeach ()
0 commit comments