Skip to content

Commit 804dd15

Browse files
Drop CDPv1 (#3344)
Fixes: #3341
1 parent cc7c1bb commit 804dd15

File tree

4 files changed

+14
-72
lines changed

4 files changed

+14
-72
lines changed

cub/cub/detail/detect_cuda_runtime.cuh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,9 @@
8585
# endif // CUB_RUNTIME_FUNCTION predefined
8686

8787
# ifdef CUB_RDC_ENABLED
88-
// Detect available version of CDP:
89-
# if __CUDACC_VER_MAJOR__ < 12 || defined(CUDA_FORCE_CDP1_IF_SUPPORTED)
90-
# define CUB_DETAIL_CDPv1
91-
# else
92-
# define CUB_DETAIL_CDPv2
93-
# endif
88+
# ifdef CUDA_FORCE_CDP1_IF_SUPPORTED
89+
# error "CUDA Dynamic Parallelism 1 is no longer supported. Please undefine CUDA_FORCE_CDP1_IF_SUPPORTED."
90+
# endif // CUDA_FORCE_CDP1_IF_SUPPORTED
9491
# endif
9592

9693
#endif // Do not document

cub/cub/detail/device_synchronize.cuh

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,7 @@ _CCCL_EXEC_CHECK_DISABLE
4545
CUB_RUNTIME_FUNCTION inline cudaError_t device_synchronize()
4646
{
4747
cudaError_t result = cudaErrorNotSupported;
48-
49-
// Device-side sync is only available under CDPv1:
50-
#if defined(CUB_DETAIL_CDPv1)
51-
52-
# if ((__CUDACC_VER_MAJOR__ > 11) || ((__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ >= 6)))
53-
// CUDA >= 11.6
54-
# define CUB_TMP_DEVICE_SYNC_IMPL result = __cudaDeviceSynchronizeDeprecationAvoidance();
55-
# else // CUDA < 11.6:
56-
# define CUB_TMP_DEVICE_SYNC_IMPL result = cudaDeviceSynchronize();
57-
# endif
58-
59-
#else // CDPv2 or no CDP:
60-
61-
# define CUB_TMP_DEVICE_SYNC_IMPL /* unavailable */
62-
63-
#endif // CDP version
64-
65-
NV_IF_TARGET(NV_IS_HOST, (result = cudaDeviceSynchronize();), (CUB_TMP_DEVICE_SYNC_IMPL));
66-
67-
#undef CUB_TMP_DEVICE_SYNC_IMPL
68-
48+
NV_IF_TARGET(NV_IS_HOST, (result = cudaDeviceSynchronize();), ());
6949
return result;
7050
}
7151

cub/cub/util_device.cuh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -487,18 +487,8 @@ CUB_RUNTIME_FUNCTION inline cudaError_t DebugSyncStream(cudaStream_t stream)
487487
"device-side sync requires <sm_90, RDC, and CDPv1"); \
488488
return cudaSuccess
489489

490-
# ifdef CUB_DETAIL_CDPv1
491-
492-
// Can sync everywhere but SM_90+
493-
NV_IF_TARGET(NV_PROVIDES_SM_90, (CUB_TMP_DEVICE_SYNC_UNAVAILABLE;), (CUB_TMP_SYNC_AVAILABLE;));
494-
495-
# else // CDPv2 or no CDP:
496-
497-
// Can only sync on host
498490
NV_IF_TARGET(NV_IS_HOST, (CUB_TMP_SYNC_AVAILABLE;), (CUB_TMP_DEVICE_SYNC_UNAVAILABLE;));
499491

500-
# endif // CDP version
501-
502492
# undef CUB_TMP_DEVICE_SYNC_UNAVAILABLE
503493
# undef CUB_TMP_SYNC_AVAILABLE
504494

thrust/thrust/system/cuda/detail/cdp_dispatch.h

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -53,45 +53,20 @@
5353
* \endcode
5454
*/
5555

56-
#if defined(CUB_DETAIL_CDPv1)
57-
58-
// Special case for NVCC -- need to inform the device path about the kernels
59-
// that are launched from the host path.
60-
# if defined(__CUDACC__) && defined(__CUDA_ARCH__)
61-
62-
// seq_impl only used on platforms that do not support device synchronization.
63-
# define THRUST_CDP_DISPATCH(par_impl, seq_impl) \
64-
if (false) \
65-
{ /* Without this, the device pass won't compile any kernels. */ \
66-
NV_IF_TARGET(NV_ANY_TARGET, par_impl); \
67-
} \
68-
NV_IF_TARGET(NV_PROVIDES_SM_90, seq_impl, par_impl)
69-
70-
# else // NVCC device pass
71-
72-
// seq_impl only used on platforms that do not support device synchronization.
73-
# define THRUST_CDP_DISPATCH(par_impl, seq_impl) NV_IF_TARGET(NV_PROVIDES_SM_90, seq_impl, par_impl)
74-
75-
# endif // NVCC device pass
76-
77-
#else // CDPv1 unavailable. Always fallback to serial on device:
78-
7956
// Special case for NVCC -- need to inform the device path about the kernels
8057
// that are launched from the host path.
81-
# if defined(__CUDACC__) && defined(__CUDA_ARCH__)
58+
#if defined(__CUDACC__) && defined(__CUDA_ARCH__)
8259

8360
// Device-side launch not supported, fallback to sequential in device code.
84-
# define THRUST_CDP_DISPATCH(par_impl, seq_impl) \
85-
if (false) \
86-
{ /* Without this, the device pass won't compile any kernels. */ \
87-
NV_IF_TARGET(NV_ANY_TARGET, par_impl); \
88-
} \
89-
NV_IF_TARGET(NV_IS_HOST, par_impl, seq_impl)
90-
91-
# else // !(NVCC device pass):
61+
# define THRUST_CDP_DISPATCH(par_impl, seq_impl) \
62+
if (false) \
63+
{ /* Without this, the device pass won't compile any kernels. */ \
64+
NV_IF_TARGET(NV_ANY_TARGET, par_impl); \
65+
} \
66+
NV_IF_TARGET(NV_IS_HOST, par_impl, seq_impl)
9267

93-
# define THRUST_CDP_DISPATCH(par_impl, seq_impl) NV_IF_TARGET(NV_IS_HOST, par_impl, seq_impl)
68+
#else // !(NVCC device pass):
9469

95-
# endif // NVCC device pass
70+
# define THRUST_CDP_DISPATCH(par_impl, seq_impl) NV_IF_TARGET(NV_IS_HOST, par_impl, seq_impl)
9671

97-
#endif // CDP version
72+
#endif // NVCC device pass

0 commit comments

Comments
 (0)