Skip to content

Commit e8a4e78

Browse files
authored
Remove _CCCL_HAS_INCLUDE (#7304)
1 parent 1170726 commit e8a4e78

File tree

25 files changed

+49
-59
lines changed

25 files changed

+49
-59
lines changed

.clang-format

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ Macros:
148148
- _CCCL_TEMPLATE(...)=template<...>
149149
- _CCCL_REQUIRES(...)=requires (...)
150150
- _CUDAX_SEMI_PRIVATE=private
151-
WhitespaceSensitiveMacros:
152-
- _CCCL_HAS_INCLUDE
153151
NamespaceIndentation: None
154152
PackConstructorInitializers: Never
155153
PenaltyBreakAssignment: 30

cudax/include/cuda/experimental/__execution/stop_token.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include <cuda/experimental/__execution/thread.cuh>
3434
#include <cuda/experimental/__execution/utility.cuh>
3535

36-
#if _CCCL_HAS_INCLUDE(<stop_token>) && __cpp_lib_jthread >= 201911
36+
#if __has_include(<stop_token>) && __cpp_lib_jthread >= 201911
3737
# include <stop_token>
3838
#endif
3939

cudax/include/cuda/experimental/__stf/internal/dot.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ inline void dot_section::push(::std::shared_ptr<per_ctx_dot>& pc, ::std::string
15101510
return;
15111511
}
15121512

1513-
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017)
1513+
#if __has_include(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017)
15141514
nvtxRangePushA(symbol.c_str());
15151515
#endif
15161516

@@ -1550,7 +1550,7 @@ inline void dot_section::pop(::std::shared_ptr<per_ctx_dot>& pc)
15501550
pc->section_id_stack.pop_back();
15511551
} // Release lock before potentially expensive NVTX call
15521552

1553-
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017)
1553+
#if __has_include(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017)
15541554
nvtxRangePop();
15551555
#endif
15561556
}

cudax/include/cuda/experimental/__stf/utility/cuda_safe_call.cuh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
#include <cuda_occupancy.h>
3939
#include <cuda_runtime.h>
4040

41-
#if _CCCL_HAS_INCLUDE(<cusolverDn.h>)
41+
#if __has_include(<cusolverDn.h>)
4242
# include <cusolverDn.h>
4343
#endif
4444

4545
namespace cuda::experimental::stf
4646
{
47-
#if _CCCL_HAS_INCLUDE(<cusolverDn.h>)
47+
#if __has_include(<cusolverDn.h>)
4848
// Undocumented
4949
inline const char* cusolverGetErrorString(const cusolverStatus_t status)
5050
{
@@ -113,10 +113,10 @@ public:
113113
{
114114
// All "success" statuses are zero
115115
static_assert(cudaSuccess == 0 && CUDA_SUCCESS == 0
116-
#if _CCCL_HAS_INCLUDE(<cublas_v2.h>)
116+
#if __has_include(<cublas_v2.h>)
117117
&& CUBLAS_STATUS_SUCCESS == 0
118118
#endif
119-
#if _CCCL_HAS_INCLUDE(<cusolverDn.h>)
119+
#if __has_include(<cusolverDn.h>)
120120
&& CUSOLVER_STATUS_SUCCESS == 0
121121
#endif
122122
,
@@ -131,7 +131,7 @@ public:
131131
int dev = -1;
132132
cudaGetDevice(&dev);
133133

134-
#if _CCCL_HAS_INCLUDE(<cusolverDn.h>)
134+
#if __has_include(<cusolverDn.h>)
135135
if constexpr (::std::is_same_v<T, cusolverStatus_t>)
136136
{
137137
format("%s(%u) [device %d] CUSOLVER error in call %s: %s.",
@@ -142,8 +142,8 @@ public:
142142
cusolverGetErrorString(status));
143143
}
144144
else
145-
#endif // _CCCL_HAS_INCLUDE(<cusolverDn.h>)
146-
#if _CCCL_HAS_INCLUDE(<cublas_v2.h>)
145+
#endif // __has_include(<cusolverDn.h>)
146+
#if __has_include(<cublas_v2.h>)
147147
if constexpr (::std::is_same_v<T, cublasStatus_t>)
148148
{
149149
format("%s(%u) [device %d] CUBLAS error in %s: %s.",
@@ -154,7 +154,7 @@ public:
154154
cublasGetStatusString(status));
155155
}
156156
else
157-
#endif // _CCCL_HAS_INCLUDE(<cublas_v2.h>)
157+
#endif // __has_include(<cublas_v2.h>)
158158
if constexpr (::std::is_same_v<T, cudaOccError>)
159159
{
160160
format("%s(%u) [device %d] CUDA OCC error in %s: %s.",
@@ -224,7 +224,7 @@ UNITTEST("cuda_exception")
224224
{
225225
auto e = cuda_exception(CUDA_SUCCESS);
226226
EXPECT(e.what()[0] == 0);
227-
# if _CCCL_HAS_INCLUDE(<cusolverDn.h>)
227+
# if __has_include(<cusolverDn.h>)
228228
auto e1 = cuda_exception(CUSOLVER_STATUS_ZERO_PIVOT);
229229
EXPECT(strlen(e1.what()) > 0u);
230230
# endif

cudax/include/cuda/experimental/__stf/utility/nvtx.cuh

Lines changed: 3 additions & 3 deletions
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_INCLUDE(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017) \
29+
#if __has_include(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017) \
3030
&& !defined(CCCL_DISABLE_NVTX) \
3131
&& !defined(NVTX_DISABLE)
3232
# include <nvtx3/nvToolsExt.h>
@@ -45,7 +45,7 @@ class nvtx_range
4545
public:
4646
explicit nvtx_range(const char* message)
4747
{
48-
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017) \
48+
#if __has_include(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017) \
4949
&& !defined(CCCL_DISABLE_NVTX) \
5050
&& !defined(NVTX_DISABLE)
5151
nvtxRangePushA(message);
@@ -83,7 +83,7 @@ public:
8383
}
8484
active = false;
8585

86-
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017) \
86+
#if __has_include(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017) \
8787
&& !defined(CCCL_DISABLE_NVTX) \
8888
&& !defined(NVTX_DISABLE)
8989
nvtxRangePop();

cudax/include/cuda/experimental/cufile.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
# error "<cuda/cufile> is not supported on Windows"
2525
#endif // _CCCL_OS(WINDOWS)
2626

27-
#if !_CCCL_HAS_INCLUDE(<cufile.h>)
27+
#if !__has_include(<cufile.h>)
2828
# error "<cuda/cufile> requires libcufile-dev package to be installed"
29-
#endif // !_CCCL_HAS_INCLUDE(<cufile.h>)
29+
#endif // !__has_include(<cufile.h>)
3030

3131
#if _CCCL_CTK_BELOW(12, 9)
3232
# error "<cuda/cufile> requires at least CUDA 12.9"

docs/cccl/development/macro.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ Usage example:
274274
+--------------------------+--------------------------------------------------+
275275
| ``_CCCL_HAS_FEATURE(X)`` | Portable ``__has_feature(X)`` |
276276
+--------------------------+--------------------------------------------------+
277-
| ``_CCCL_HAS_INCLUDE(X)`` | Portable ``__has_include(X)`` (before C++17) |
278-
+--------------------------+--------------------------------------------------+
279277

280278
**Portable attributes**:
281279

libcudacxx/include/cuda/__nvtx/nvtx.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// * NVTX is not explicitly disabled (via CCCL_DISABLE_NVTX or NVTX_DISABLE)
3333
// * the compiler is not nvc++ (NVTX3 uses module as an identifier, which trips up NVHPC, fixed in CTK >= 13.0)
3434
// * the compiler is not NVRTC
35-
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && !defined(CCCL_DISABLE_NVTX) && !defined(NVTX_DISABLE) \
35+
#if __has_include(<nvtx3/nvToolsExt.h>) && !defined(CCCL_DISABLE_NVTX) && !defined(NVTX_DISABLE) \
3636
&& (!_CCCL_COMPILER(NVHPC) || _CCCL_CTK_AT_LEAST(13, 0)) \
3737
&& !_CCCL_COMPILER(NVRTC)
3838

@@ -45,11 +45,11 @@
4545

4646
// Include our NVTX3 C++ wrapper if not available from the CTK or not provided by the user
4747
// Note: NVTX3 is available in the CTK since 12.9, so we can drop our copy once this is the minimum supported version
48-
# if _CCCL_HAS_INCLUDE(<nvtx3/nvtx3.hpp>)
48+
# if __has_include(<nvtx3/nvtx3.hpp>)
4949
# include <nvtx3/nvtx3.hpp>
50-
# else // _CCCL_HAS_INCLUDE(<nvtx3/nvtx3.hpp>)
50+
# else // __has_include(<nvtx3/nvtx3.hpp>)
5151
# include <cuda/__nvtx/nvtx3.h>
52-
# endif // _CCCL_HAS_INCLUDE(<nvtx3/nvtx3.hpp>)
52+
# endif // __has_include(<nvtx3/nvtx3.hpp>)
5353

5454
# ifndef NVTX_AS_SYSTEM_HEADER_DEFINED_BY_USER
5555
# undef NVTX_AS_SYSTEM_HEADER
@@ -71,7 +71,7 @@
7171
# warning nvtx3.h is available but does not define the V1 API. This is odd. Please open a GitHub issue at: https://github.com/NVIDIA/cccl/issues.
7272
# endif
7373
# endif // NVTX3_CPP_DEFINITIONS_V1_0
74-
#endif // _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && !defined(CCCL_DISABLE_NVTX) && !defined(NVTX_DISABLE) &&
74+
#endif // __has_include(<nvtx3/nvToolsExt.h>) && !defined(CCCL_DISABLE_NVTX) && !defined(NVTX_DISABLE) &&
7575
// (!_CCCL_COMPILER(NVHPC)) && !_CCCL_COMPILER(NVRTC)
7676

7777
#if _CCCL_HAS_NVTX3()

libcudacxx/include/cuda/std/__cccl/architecture.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
5858
# define _CCCL_ENDIAN_NATIVE() _CCCL_ENDIAN_BIG()
5959
# endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
60-
#elif _CCCL_HAS_INCLUDE(<endian.h>)
60+
#elif __has_include(<endian.h>)
6161
# include <endian.h>
6262
# if __BYTE_ORDER == __LITTLE_ENDIAN
6363
# define _CCCL_ENDIAN_NATIVE() _CCCL_ENDIAN_LITTLE()

libcudacxx/include/cuda/std/__cccl/assert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
# define _CCCL_ASSERT_IMPL_HOST(expression, message) ((void) 0)
6767
#elif _CCCL_COMPILER(NVRTC) // There is no host standard library in nvrtc
6868
# define _CCCL_ASSERT_IMPL_HOST(expression, message) ((void) 0)
69-
#elif _CCCL_HAS_INCLUDE(<yvals.h>) && _CCCL_OS(WINDOWS) // Windows uses _STL_VERIFY from <yvals.h>
69+
#elif __has_include(<yvals.h>) && _CCCL_OS(WINDOWS) // Windows uses _STL_VERIFY from <yvals.h>
7070
# include <yvals.h>
7171
# define _CCCL_ASSERT_IMPL_HOST(expression, message) _STL_VERIFY(expression, message)
7272
#else // ^^^ MSVC STL ^^^ / vvv !MSVC STL vvv

0 commit comments

Comments
 (0)