Skip to content

Commit 37bd0a4

Browse files
Drop CUB_RUNTIME_ENABLED and __THRUST_HAS_CUDART__ (#3305)
1 parent e7e74a1 commit 37bd0a4

File tree

4 files changed

+0
-109
lines changed

4 files changed

+0
-109
lines changed

cub/cub/detail/detect_cuda_runtime.cuh

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -73,40 +73,15 @@
7373
*/
7474
# define CUB_RUNTIME_FUNCTION
7575

76-
/**
77-
* \def CUB_RUNTIME_ENABLED
78-
*
79-
* Whether or not the active compiler pass is allowed to invoke device kernels
80-
* or methods from the CUDA runtime API.
81-
*
82-
* This macro should not be used in CUB, as it depends on `__CUDA_ARCH__`
83-
* and is not compatible with `NV_IF_TARGET`. It is provided for legacy
84-
* purposes only.
85-
*
86-
* Replace any usages with `CUB_RDC_ENABLED` and `NV_IF_TARGET`.
87-
*/
88-
# define CUB_RUNTIME_ENABLED
89-
9076
#else // Non-doxygen pass:
9177

9278
# ifndef CUB_RUNTIME_FUNCTION
93-
9479
# if defined(__CUDACC_RDC__) && !defined(CUB_DISABLE_CDP)
95-
9680
# define CUB_RDC_ENABLED
9781
# define CUB_RUNTIME_FUNCTION _CCCL_HOST_DEVICE
98-
9982
# else // RDC disabled:
100-
10183
# define CUB_RUNTIME_FUNCTION _CCCL_HOST
102-
10384
# endif // RDC enabled
104-
105-
# if !defined(__CUDA_ARCH__) || defined(__CUDACC_RDC__)
106-
// Legacy only -- do not use in new code.
107-
# define CUB_RUNTIME_ENABLED
108-
# endif
109-
11085
# endif // CUB_RUNTIME_FUNCTION predefined
11186

11287
# ifdef CUB_RDC_ENABLED

cub/test/cmake/check_source_files.cmake

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,6 @@ if (NOT valid_count EQUAL 5)
8383
"Matched ${valid_count} times, expected 5.")
8484
endif()
8585

86-
################################################################################
87-
# Legacy macro checks.
88-
# Check all files in CUB to make sure that they aren't using the legacy
89-
# CUB_RUNTIME_ENABLED and __THRUST_HAS_CUDART__ macros.
90-
#
91-
# These macros depend on __CUDA_ARCH__ and are not compatible with NV_IF_TARGET.
92-
# They are provided for legacy purposes and should be replaced with
93-
# [THRUST|CUB]_RDC_ENABLED and NV_IF_TARGET in Thrust/CUB code.
94-
#
95-
#
96-
set(legacy_macro_header_exclusions
97-
# This header defines a legacy CUDART macro:
98-
cub/detail/detect_cuda_runtime.cuh
99-
)
100-
101-
set(cub_legacy_macro_regex "CUB_RUNTIME_ENABLED")
102-
set(thrust_legacy_macro_regex "__THRUST_HAS_CUDART__")
103-
10486
################################################################################
10587
# Read source files:
10688
foreach(src ${cub_srcs})
@@ -156,21 +138,6 @@ foreach(src ${cub_srcs})
156138
set(found_errors 1)
157139
endif()
158140
endif()
159-
160-
if (NOT ${src} IN_LIST legacy_macro_header_exclusions)
161-
count_substrings("${src_contents}" "${thrust_legacy_macro_regex}" thrust_count)
162-
count_substrings("${src_contents}" "${cub_legacy_macro_regex}" cub_count)
163-
164-
if (NOT thrust_count EQUAL 0)
165-
message("'${src}' uses __THRUST_HAS_CUDART__. Replace with THRUST_RDC_ENABLED and NV_IF_TARGET.")
166-
set(found_errors 1)
167-
endif()
168-
169-
if (NOT cub_count EQUAL 0)
170-
message("'${src}' uses CUB_RUNTIME_ENABLED. Replace with CUB_RDC_ENABLED and NV_IF_TARGET.")
171-
set(found_errors 1)
172-
endif()
173-
endif()
174141
endforeach()
175142

176143
if (NOT found_errors EQUAL 0)

thrust/testing/cmake/check_source_files.cmake

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,6 @@ if (NOT valid_count EQUAL 5)
8484
"Matched ${valid_count} times, expected 5.")
8585
endif()
8686

87-
################################################################################
88-
# Legacy macro checks.
89-
# Check all files in Thrust to make sure that they aren't using the legacy
90-
# CUB_RUNTIME_ENABLED and __THRUST_HAS_CUDART__ macros.
91-
#
92-
# These macros depend on __CUDA_ARCH__ and are not compatible with NV_IF_TARGET.
93-
# They are provided for legacy purposes and should be replaced with
94-
# [THRUST|CUB]_RDC_ENABLED and NV_IF_TARGET in Thrust/CUB code.
95-
#
96-
#
97-
set(legacy_macro_header_exclusions
98-
# This header defines a legacy CUDART macro:
99-
thrust/system/cuda/config.h
100-
)
101-
102-
set(cub_legacy_macro_regex "CUB_RUNTIME_ENABLED")
103-
set(thrust_legacy_macro_regex "__THRUST_HAS_CUDART__")
104-
10587
################################################################################
10688
# Read source files:
10789
foreach(src ${thrust_srcs})
@@ -163,21 +145,6 @@ foreach(src ${thrust_srcs})
163145
set(found_errors 1)
164146
endif()
165147
endif()
166-
167-
if (NOT ${src} IN_LIST legacy_macro_header_exclusions)
168-
count_substrings("${src_contents}" "${thrust_legacy_macro_regex}" thrust_count)
169-
count_substrings("${src_contents}" "${cub_legacy_macro_regex}" cub_count)
170-
171-
if (NOT thrust_count EQUAL 0)
172-
message("'${src}' uses __THRUST_HAS_CUDART__. Replace with THRUST_RDC_ENABLED and NV_IF_TARGET.")
173-
set(found_errors 1)
174-
endif()
175-
176-
if (NOT cub_count EQUAL 0)
177-
message("'${src}' uses CUB_RUNTIME_ENABLED. Replace with CUB_RDC_ENABLED and NV_IF_TARGET.")
178-
set(found_errors 1)
179-
endif()
180-
endif()
181148
endforeach()
182149

183150
if (NOT found_errors EQUAL 0)

thrust/thrust/system/cuda/config.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,6 @@
6666
# define THRUST_RDC_ENABLED
6767
#endif
6868

69-
/**
70-
* \def __THRUST_HAS_CUDART__
71-
*
72-
* Whether or not the active compiler pass is allowed to invoke device kernels
73-
* or methods from the CUDA runtime API.
74-
*
75-
* This macro should not be used in Thrust, as it depends on `__CUDA_ARCH__`
76-
* and is not compatible with `NV_IF_TARGET`. It is provided for legacy
77-
* purposes only.
78-
*
79-
* Replace any usages with `THRUST_RDC_ENABLED` and `NV_IF_TARGET`.
80-
*/
81-
#ifdef CUB_RUNTIME_ENABLED
82-
# define __THRUST_HAS_CUDART__ 1
83-
#else
84-
# define __THRUST_HAS_CUDART__ 0
85-
#endif
86-
8769
#ifdef THRUST_AGENT_ENTRY_NOINLINE
8870
# define THRUST_AGENT_ENTRY_INLINE_ATTR __noinline__
8971
#else

0 commit comments

Comments
 (0)