Skip to content

Commit e72c346

Browse files
committed
Add NVRTC compatibility warnings to CUB headers
1 parent 8136b82 commit e72c346

20 files changed

+140
-0
lines changed

cub/cub/device/device_adjacent_difference.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
#include <cub/config.cuh>
77

8+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
9+
# if _CCCL_COMPILER(NVRTC)
10+
# error \
11+
"Including <cub/device/device_adjacent_difference.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
12+
# endif // _CCCL_COMPILER(NVRTC)
13+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
14+
815
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
916
# pragma GCC system_header
1017
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

cub/cub/device/device_copy.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
#include <cub/config.cuh>
1010

11+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
12+
# if _CCCL_COMPILER(NVRTC)
13+
# error \
14+
"Including <cub/device/device_copy.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
15+
# endif // _CCCL_COMPILER(NVRTC)
16+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
17+
1118
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
1219
# pragma GCC system_header
1320
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

cub/cub/device/device_for.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
#include <cub/config.cuh>
77

8+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
9+
# if _CCCL_COMPILER(NVRTC)
10+
# error \
11+
"Including <cub/device/device_for.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
12+
# endif // _CCCL_COMPILER(NVRTC)
13+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
14+
815
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
916
# pragma GCC system_header
1017
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

cub/cub/device/device_histogram.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
#include <cub/config.cuh>
1212

13+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
14+
# if _CCCL_COMPILER(NVRTC)
15+
# error \
16+
"Including <cub/device/device_histogram.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
17+
# endif // _CCCL_COMPILER(NVRTC)
18+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
19+
1320
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
1421
# pragma GCC system_header
1522
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

cub/cub/device/device_memcpy.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
#include <cub/config.cuh>
1010

11+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
12+
# if _CCCL_COMPILER(NVRTC)
13+
# error \
14+
"Including <cub/device/device_memcpy.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
15+
# endif // _CCCL_COMPILER(NVRTC)
16+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
17+
1118
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
1219
# pragma GCC system_header
1320
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

cub/cub/device/device_merge.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
#include <cub/config.cuh>
77

8+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
9+
# if _CCCL_COMPILER(NVRTC)
10+
# error \
11+
"Including <cub/device/device_merge.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
12+
# endif // _CCCL_COMPILER(NVRTC)
13+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
14+
815
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
916
# pragma GCC system_header
1017
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

cub/cub/device/device_merge_sort.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55

66
#include <cub/config.cuh>
77

8+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
9+
# if _CCCL_COMPILER(NVRTC)
10+
# error \
11+
"Including <cub/device/device_merge_sort.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
12+
# endif // _CCCL_COMPILER(NVRTC)
13+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
14+
815
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
916
# pragma GCC system_header
1017
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

cub/cub/device/device_partition.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
#include <cub/config.cuh>
1212

13+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
14+
# if _CCCL_COMPILER(NVRTC)
15+
# error \
16+
"Including <cub/device/device_partition.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
17+
# endif // _CCCL_COMPILER(NVRTC)
18+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
19+
1320
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
1421
# pragma GCC system_header
1522
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

cub/cub/device/device_radix_sort.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
#include <cub/config.cuh>
1212

13+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
14+
# if _CCCL_COMPILER(NVRTC)
15+
# error \
16+
"Including <cub/device/device_radix_sort.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
17+
# endif // _CCCL_COMPILER(NVRTC)
18+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
19+
1320
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
1421
# pragma GCC system_header
1522
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

cub/cub/device/device_reduce.cuh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
#include <cub/config.cuh>
1212

13+
#ifndef CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
14+
# if _CCCL_COMPILER(NVRTC)
15+
# error \
16+
"Including <cub/device/device_reduce.cuh> is not supported when compiling with NVRTC. Include block-, warp-, or thread-level primitives instead (e.g. <cub/block/block_reduce.cuh>). You can define CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK to disable this warning."
17+
# endif // _CCCL_COMPILER(NVRTC)
18+
#endif // CCCL_DISABLE_CUB_NVRTC_COMPATIBILITY_CHECK
19+
1320
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
1421
# pragma GCC system_header
1522
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)

0 commit comments

Comments
 (0)