Skip to content

Commit 37bc668

Browse files
committed
Replace _CCCL_HAS_CUDA_COMPILER() with _CCCL_CUDA_COMPILATION()
1 parent 510dcc2 commit 37bc668

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+64
-63
lines changed

cub/cub/util_device.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,6 @@ private:
797797
};
798798
CUB_NAMESPACE_END
799799

800-
#if _CCCL_HAS_CUDA_COMPILER() && !_CCCL_COMPILER(NVRTC)
800+
#if _CCCL_CUDA_COMPILATION() && !_CCCL_COMPILER(NVRTC)
801801
# include <cub/detail/launcher/cuda_runtime.cuh> // to complete the definition of TripleChevronFactory
802-
#endif // _CCCL_HAS_CUDA_COMPILER() && !_CCCL_COMPILER(NVRTC)
802+
#endif // _CCCL_CUDA_COMPILATION() && !_CCCL_COMPILER(NVRTC)

cudax/include/cuda/experimental/__container/async_buffer.cuh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
# pragma system_header
2222
#endif // no system header
2323

24-
#if _CCCL_HAS_CUDA_COMPILER()
24+
#if _CCCL_CUDA_COMPILATION()
2525
# include <cub/device/device_transform.cuh>
26-
#endif // _CCCL_HAS_CUDA_COMPILER()
26+
#endif // _CCCL_CUDA_COMPILATION()
2727

2828
#include <cuda/__memory_resource/any_resource.h>
2929
#include <cuda/__memory_resource/get_memory_resource.h>
@@ -605,12 +605,13 @@ __fill_n(cuda::stream_ref __stream, _Tp* __first, ::cuda::std::size_t __count, c
605605
}
606606
else
607607
{
608-
#if _CCCL_HAS_CUDA_COMPILER()
608+
#if _CCCL_CUDA_COMPILATION()
609609
::cuda::experimental::__ensure_current_device __guard(__stream);
610610
::cub::DeviceTransform::Fill(__first, __count, __value, __stream.get());
611-
#else
612-
static_assert(0, "CUDA compiler is required to initialize an async_buffer with elements larger than 4 bytes");
613-
#endif
611+
#else // ^^^ _CCCL_CUDA_COMPILATION() ^^^ / vvv !_CCCL_CUDA_COMPILATION() vvv
612+
static_assert(sizeof(_Tp) <= 4,
613+
"CUDA compiler is required to initialize an async_buffer with elements larger than 4 bytes");
614+
#endif // ^^^ !_CCCL_CUDA_COMPILATION() ^^^
614615
}
615616
}
616617
}

libcudacxx/codegen/generators/header.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ inline void FormatHeader(std::ostream& out)
5959
6060
_CCCL_BEGIN_NAMESPACE_CUDA_STD
6161
62-
#if _CCCL_HAS_CUDA_COMPILER()
62+
#if _CCCL_CUDA_COMPILATION()
6363
6464
extern "C" _CCCL_DEVICE void __atomic_cas_128b_unsupported_before_SM_90();
6565
extern "C" _CCCL_DEVICE void __atomic_exchange_128b_unsupported_before_SM_90();
@@ -72,7 +72,7 @@ extern "C" _CCCL_DEVICE void __atomic_ldst_128b_unsupported_before_SM_70();
7272
inline void FormatTail(std::ostream& out)
7373
{
7474
std::string tail = R"XXX(
75-
#endif // _CCCL_HAS_CUDA_COMPILER()
75+
#endif // _CCCL_CUDA_COMPILATION()
7676
7777
_CCCL_END_NAMESPACE_CUDA_STD
7878

libcudacxx/include/cuda/__memcpy_async/memcpy_async.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# pragma system_header
2323
#endif // no system header
2424

25-
#if _CCCL_HAS_CUDA_COMPILER()
25+
#if _CCCL_CUDA_COMPILATION()
2626

2727
# include <cuda/__barrier/async_contract_fulfillment.h>
2828
# include <cuda/__barrier/barrier.h>
@@ -174,6 +174,6 @@ _CCCL_END_NAMESPACE_CUDA
174174

175175
# include <cuda/std/__cccl/epilogue.h>
176176

177-
#endif // _CCCL_HAS_CUDA_COMPILER()
177+
#endif // _CCCL_CUDA_COMPILATION()
178178

179179
#endif // _CUDA___MEMCPY_ASYNC_MEMCPY_ASYNC_H_

libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_generated.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
_CCCL_BEGIN_NAMESPACE_CUDA_STD
4444

45-
#if _CCCL_HAS_CUDA_COMPILER()
45+
#if _CCCL_CUDA_COMPILATION()
4646

4747
extern "C" _CCCL_DEVICE void __atomic_cas_128b_unsupported_before_SM_90();
4848
extern "C" _CCCL_DEVICE void __atomic_exchange_128b_unsupported_before_SM_90();
@@ -4426,7 +4426,7 @@ template <class _Type, class _Up, class _Sco>
44264426
return __atomic_fetch_add_cuda(__ptr, -__op, __memorder, _Sco{});
44274427
}
44284428

4429-
#endif // _CCCL_HAS_CUDA_COMPILER()
4429+
#endif // _CCCL_CUDA_COMPILATION()
44304430

44314431
_CCCL_END_NAMESPACE_CUDA_STD
44324432

thrust/examples/include/host_device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include <cuda/__cccl_config>
2020

21-
#if !_CCCL_HAS_CUDA_COMPILER()
21+
#if !_CCCL_CUDA_COMPILATION()
2222

2323
# ifndef __host__
2424
# define __host__

thrust/thrust/random/detail/normal_distribution_base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class normal_distribution_portable
148148
template <typename RealType>
149149
struct normal_distribution_base
150150
{
151-
#if _CCCL_HAS_CUDA_COMPILER() && !_CCCL_CUDA_COMPILER(NVHPC)
151+
#if _CCCL_CUDA_COMPILATION() && !_CCCL_CUDA_COMPILER(NVHPC)
152152
using type = normal_distribution_nvcc<RealType>;
153153
#else
154154
using type = normal_distribution_portable<RealType>;

thrust/thrust/system/cuda/detail/adjacent_difference.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
# pragma system_header
3737
#endif // no system header
3838

39-
#if _CCCL_HAS_CUDA_COMPILER()
39+
#if _CCCL_CUDA_COMPILATION()
4040

4141
# include <thrust/system/cuda/config.h>
4242

thrust/thrust/system/cuda/detail/assign_value.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# pragma system_header
2727
#endif // no system header
2828

29-
#if _CCCL_HAS_CUDA_COMPILER()
29+
#if _CCCL_CUDA_COMPILATION()
3030

3131
# include <thrust/detail/raw_pointer_cast.h>
3232
# include <thrust/system/cuda/detail/cross_system.h>

thrust/thrust/system/cuda/detail/copy.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
#include <thrust/system/cuda/detail/util.h>
4949
#include <thrust/type_traits/is_trivially_relocatable.h>
5050

51-
#if _CCCL_HAS_CUDA_COMPILER()
51+
#if _CCCL_CUDA_COMPILATION()
5252
# include <cub/device/dispatch/tuning/tuning_transform.cuh>
53-
#endif // _CCCL_HAS_CUDA_COMPILER()
53+
#endif // _CCCL_CUDA_COMPILATION()
5454

5555
#include <cuda/__fwd/zip_iterator.h>
5656
#include <cuda/std/tuple>
@@ -131,7 +131,7 @@ OutputIt _CCCL_HOST non_trivial_cross_system_copy_n(
131131
return ret;
132132
}
133133

134-
#if _CCCL_HAS_CUDA_COMPILER()
134+
#if _CCCL_CUDA_COMPILATION()
135135
// non-trivial copy D->H, only supported with NVCC compiler
136136
// because copy ctor must have __device__ annotations, which is nvcc-only
137137
// feature
@@ -158,7 +158,7 @@ OutputIt _CCCL_HOST non_trivial_cross_system_copy_n(
158158
OutputIt ret = thrust::copy_n(host_s, temp_host.data(), num_items, result);
159159
return ret;
160160
}
161-
#endif // _CCCL_HAS_CUDA_COMPILER()
161+
#endif // _CCCL_CUDA_COMPILATION()
162162

163163
template <class System1, class System2, class InputIt, class Size, class OutputIt>
164164
OutputIt _CCCL_HOST cross_system_copy_n(cross_system<System1, System2> systems, InputIt begin, Size n, OutputIt result)
@@ -188,7 +188,7 @@ OutputIt _CCCL_HOST cross_system_copy_n(cross_system<System1, System2> systems,
188188
}
189189
}
190190

191-
#if _CCCL_HAS_CUDA_COMPILER()
191+
#if _CCCL_CUDA_COMPILATION()
192192
template <class Derived, class InputIt, class OutputIt>
193193
OutputIt THRUST_RUNTIME_FUNCTION
194194
device_to_device(execution_policy<Derived>& policy, InputIt first, InputIt last, OutputIt result)
@@ -229,10 +229,10 @@ device_to_device(execution_policy<Derived>& policy, InputIt first, InputIt last,
229229
policy, first, last, result, ::cuda::proclaim_copyable_arguments(::cuda::std::identity{}));
230230
}
231231
}
232-
#endif // _CCCL_HAS_CUDA_COMPILER()
232+
#endif // _CCCL_CUDA_COMPILATION()
233233
} // namespace __copy
234234

235-
#if _CCCL_HAS_CUDA_COMPILER()
235+
#if _CCCL_CUDA_COMPILATION()
236236

237237
_CCCL_EXEC_CHECK_DISABLE
238238
template <class System, class InputIterator, class OutputIterator>
@@ -253,7 +253,7 @@ copy_n(execution_policy<System>& system, InputIterator first, Size n, OutputIter
253253
(result = thrust::copy_n(cvt_to_seq(derived_cast(system)), first, n, result);));
254254
return result;
255255
}
256-
#endif // _CCCL_HAS_CUDA_COMPILER()
256+
#endif // _CCCL_CUDA_COMPILATION()
257257

258258
template <class System1, class System2, class InputIterator, class OutputIterator>
259259
OutputIterator _CCCL_HOST

0 commit comments

Comments
 (0)