Skip to content

Commit 21639f2

Browse files
davebayermiscco
andauthored
implement new compiler checks for NVHPC (#2816)
* implement new compiler checks for NVHPC --------- Co-authored-by: Michael Schellenberger Costa <[email protected]>
1 parent 1459bc2 commit 21639f2

File tree

15 files changed

+57
-40
lines changed

15 files changed

+57
-40
lines changed

cub/cub/detail/nvtx.cuh

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
// * NVTX3 uses module as an identifier, which trips up NVHPC
5050
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && !defined(CCCL_DISABLE_NVTX) && !defined(NVTX_DISABLE) \
5151
&& _CCCL_STD_VER >= 2014 \
52-
&& (!defined(_CCCL_COMPILER_NVHPC) || _CCCL_STD_VER <= 2017)
52+
&& (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017)
5353
// Include our NVTX3 C++ wrapper if not available from the CTK
5454
// TODO(bgruber): replace by a check for the first CTK version shipping the header
5555
# if _CCCL_HAS_INCLUDE(<nvtx3/nvtx3.hpp>)

cub/cub/util_type.cuh

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ CUB_NAMESPACE_BEGIN
7575
# else // !defined(__CUDACC_RTC__)
7676
# if _CCCL_CUDACC_VER >= 1105000
7777
# if defined(_CCCL_COMPILER_GCC) || defined(_CCCL_COMPILER_CLANG) || defined(_CCCL_COMPILER_ICC) \
78-
|| defined(_CCCL_COMPILER_NVHPC)
78+
|| _CCCL_COMPILER(NVHPC)
7979
# define CUB_IS_INT128_ENABLED 1
8080
# endif // GCC || CLANG || ICC || NVHPC
8181
# endif // CTK >= 11.5

cudax/include/cuda/experimental/__async/thread.cuh

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace cuda::experimental::__async
3636
{
3737
#if defined(__CUDA_ARCH__)
3838
using __thread_id = int;
39-
#elif defined(_CCCL_COMPILER_NVHPC)
39+
#elif _CCCL_COMPILER(NVHPC)
4040
struct __thread_id
4141
{
4242
union

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

+3-3
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>) && (!defined(_CCCL_COMPILER_NVHPC) || _CCCL_STD_VER <= 2017)
29+
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017)
3030
# include <nvtx3/nvToolsExt.h>
3131
#endif
3232

@@ -41,7 +41,7 @@ class nvtx_range
4141
public:
4242
nvtx_range(const char* message)
4343
{
44-
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && (!defined(_CCCL_COMPILER_NVHPC) || _CCCL_STD_VER <= 2017)
44+
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017)
4545
nvtxRangePushA(message);
4646
#endif
4747
}
@@ -53,7 +53,7 @@ public:
5353

5454
~nvtx_range()
5555
{
56-
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && (!defined(_CCCL_COMPILER_NVHPC) || _CCCL_STD_VER <= 2017)
56+
#if _CCCL_HAS_INCLUDE(<nvtx3/nvToolsExt.h>) && (!_CCCL_COMPILER(NVHPC) || _CCCL_STD_VER <= 2017)
5757
nvtxRangePop();
5858
#endif
5959
}

libcudacxx/include/cuda/__memory_resource/get_property.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ _CCCL_INLINE_VAR constexpr bool has_property<
5151
_CUDA_VSTD::void_t<decltype(get_property(_CUDA_VSTD::declval<const _Resource&>(), _CUDA_VSTD::declval<_Property>()))>> =
5252
true;
5353

54-
# if defined(_CCCL_COMPILER_NVHPC) // NVHPC has issues accepting this at compile time if it is in a variable template
54+
# if _CCCL_COMPILER(NVHPC) // NVHPC has issues accepting this at compile time if it is in a variable template
5555
template <class _Resource, class _Property, class = void>
5656
struct __has_property_impl
5757
{
@@ -66,7 +66,7 @@ struct __has_property_impl<
6666
{
6767
static constexpr bool value = true;
6868
};
69-
# endif // _CCCL_COMPILER_NVHPC
69+
# endif // _CCCL_COMPILER(NVHPC)
7070

7171
template <class _Property>
7272
using __property_value_t = typename _Property::value_type;

libcudacxx/include/cuda/__memory_resource/resource.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -83,23 +83,23 @@ _LIBCUDACXX_CONCEPT async_resource = _LIBCUDACXX_REQUIRES_EXPR(
8383
//! @tparam _Properties
8484
template <class _Resource, class... _Properties>
8585
_LIBCUDACXX_CONCEPT resource_with =
86-
# if defined(_CCCL_COMPILER_NVHPC)
86+
# if _CCCL_COMPILER(NVHPC)
8787
resource<_Resource> && _CUDA_VSTD::__fold_and_v<__has_property_impl<_Resource, _Properties>::value...>;
88-
# else // ^^^ _CCCL_COMPILER_NVHPC ^^^ / vvv !_CCCL_COMPILER_NVHPC vvv
88+
# else // ^^^ _CCCL_COMPILER(NVHPC) ^^^ / vvv !_CCCL_COMPILER(NVHPC) vvv
8989
resource<_Resource> && _CUDA_VSTD::__fold_and_v<has_property<_Resource, _Properties>...>;
90-
# endif // !_CCCL_COMPILER_NVHPC
90+
# endif // !_CCCL_COMPILER(NVHPC)
9191

9292
//! @brief The \c async_resource_with concept verifies that a type Resource satisfies the `async_resource`
9393
//! concept and also satisfies all the provided Properties
9494
//! @tparam _Resource
9595
//! @tparam _Properties
9696
template <class _Resource, class... _Properties>
9797
_LIBCUDACXX_CONCEPT async_resource_with =
98-
# if defined(_CCCL_COMPILER_NVHPC)
98+
# if _CCCL_COMPILER(NVHPC)
9999
async_resource<_Resource> && _CUDA_VSTD::__fold_and_v<__has_property_impl<_Resource, _Properties>::value...>;
100-
# else // ^^^ _CCCL_COMPILER_NVHPC ^^^ / vvv !_CCCL_COMPILER_NVHPC vvv
100+
# else // ^^^ _CCCL_COMPILER(NVHPC) ^^^ / vvv !_CCCL_COMPILER(NVHPC) vvv
101101
async_resource<_Resource> && _CUDA_VSTD::__fold_and_v<has_property<_Resource, _Properties>...>;
102-
# endif // !_CCCL_COMPILER_NVHPC
102+
# endif // !_CCCL_COMPILER(NVHPC)
103103

104104
template <bool _Convertible>
105105
struct __different_resource__

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
# define _CCCL_FALLTHROUGH() ((void) 0)
4444
#elif _CCCL_HAS_CPP_ATTRIBUTE(clang::fallthrough)
4545
# define _CCCL_FALLTHROUGH() [[clang::fallthrough]]
46-
#elif defined(_CCCL_COMPILER_NVHPC)
46+
#elif _CCCL_COMPILER(NVHPC)
4747
# define _CCCL_FALLTHROUGH()
4848
#elif _CCCL_HAS_ATTRIBUTE(fallthough) || _GNUC_VER >= 700
4949
# define _CCCL_FALLTHROUGH() __attribute__((__fallthrough__))

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898

9999
// nvhpc has a bug where it supports __builtin_addressof but does not mark it via _CCCL_CHECK_BUILTIN
100100
#if _CCCL_CHECK_BUILTIN(builtin_addressof) || (defined(_CCCL_COMPILER_GCC) && _CCCL_GCC_VERSION >= 70000) \
101-
|| defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVHPC)
101+
|| defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVHPC)
102102
# define _CCCL_BUILTIN_ADDRESSOF(...) __builtin_addressof(__VA_ARGS__)
103103
#endif // _CCCL_CHECK_BUILTIN(builtin_addressof)
104104

@@ -180,7 +180,7 @@
180180

181181
// NVCC and NVRTC in C++11 mode freaks out about `__builtin_is_constant_evaluated`.
182182
#if _CCCL_STD_VER < 2014 \
183-
&& (defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_COMPILER_NVRTC) || defined(_CCCL_COMPILER_NVHPC))
183+
&& (defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_COMPILER_NVRTC) || _CCCL_COMPILER(NVHPC))
184184
# undef _CCCL_BUILTIN_IS_CONSTANT_EVALUATED
185185
#endif // _CCCL_STD_VER < 2014 && _CCCL_CUDA_COMPILER_NVCC
186186

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

+20-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#ifndef __CCCL_COMPILER_H
1212
#define __CCCL_COMPILER_H
1313

14+
#define _CCCL_COMPILER_MAKE_VERSION(_MAJOR, _MINOR) (_MAJOR * 100 + _MINOR)
15+
1416
// Determine the host compiler and its version
1517
#if defined(__INTEL_COMPILER)
1618
# define _CCCL_COMPILER_ICC
@@ -19,9 +21,7 @@
1921
"Support for the Intel C++ Compiler Classic is deprecated and will eventually be removed. Define CCCL_SUPPRESS_ICC_DEPRECATION_WARNING to suppress this warning"
2022
# endif // CCCL_SUPPRESS_ICC_DEPRECATION_WARNING
2123
#elif defined(__NVCOMPILER)
22-
# define _CCCL_COMPILER_NVHPC
23-
# define _CCCL_COMPILER_NVHPC_VERSION \
24-
(__NVCOMPILER_MAJOR__ * 10000 + __NVCOMPILER_MINOR__ * 100 + __NVCOMPILER_PATCHLEVEL__)
24+
# define _CCCL_COMPILER_NVHPC _CCCL_COMPILER_MAKE_VERSION(__NVCOMPILER_MAJOR__, __NVCOMPILER_MINOR__)
2525
#elif defined(__clang__)
2626
# define _CCCL_COMPILER_CLANG
2727
# define _CCCL_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
@@ -36,6 +36,23 @@
3636
# define _CCCL_COMPILER_NVRTC
3737
#endif
3838

39+
#define _CCCL_COMPILER_COMPARE_VERSION_1(_COMP) _COMP
40+
#define _CCCL_COMPILER_COMPARE_VERSION_3(_COMP, _OP, _MAJOR) _CCCL_COMPILER_COMPARE_VERSION_4(_COMP, _OP, _MAJOR, 0)
41+
#define _CCCL_COMPILER_COMPARE_VERSION_4(_COMP, _OP, _MAJOR, _MINOR) \
42+
(_COMP && (_COMP _OP _CCCL_COMPILER_MAKE_VERSION(_MAJOR, _MINOR)))
43+
44+
#define _CCCL_COMPILER_SELECT_COUNT(_ARG1, _ARG2, _ARG3, _ARG4, _ARG5, ...) _ARG5
45+
#define _CCCL_COMPILER_SELECT(...) \
46+
_CCCL_COMPILER_SELECT_COUNT( \
47+
__VA_ARGS__, \
48+
_CCCL_COMPILER_COMPARE_VERSION_4, \
49+
_CCCL_COMPILER_COMPARE_VERSION_3, \
50+
_CCCL_COMPILER_COMPARE_BAD_ARG_COUNT, \
51+
_CCCL_COMPILER_COMPARE_VERSION_1, \
52+
_CCCL_COMPILER_COMPARE_BAD_ARG_COUNT)
53+
// Fixme for MSVC without /Zc:preprocessor option
54+
#define _CCCL_COMPILER(...) _CCCL_COMPILER_SELECT(_CCCL_COMPILER_##__VA_ARGS__)(_CCCL_COMPILER_##__VA_ARGS__)
55+
3956
// Convenient shortcut to determine which version of MSVC we are dealing with
4057
#if defined(_CCCL_COMPILER_MSVC)
4158
# if _MSC_VER < 1920

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
# define _CCCL_DIAG_SUPPRESS_NVHPC(str)
4848
# define _CCCL_DIAG_SUPPRESS_MSVC(str)
4949
# define _CCCL_DIAG_SUPPRESS_ICC(str) _CCCL_PRAGMA(warning disable str)
50-
#elif defined(_CCCL_COMPILER_NVHPC)
50+
#elif _CCCL_COMPILER(NVHPC)
5151
# define _CCCL_DIAG_PUSH _CCCL_PRAGMA(diagnostic push)
5252
# define _CCCL_DIAG_POP _CCCL_PRAGMA(diagnostic pop)
5353
# define _CCCL_DIAG_SUPPRESS_CLANG(str)
@@ -91,7 +91,7 @@
9191
_CCCL_DIAG_SUPPRESS_GCC("-Wdeprecated") \
9292
_CCCL_DIAG_SUPPRESS_GCC("-Wdeprecated-declarations")
9393
# define _CCCL_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP
94-
#elif defined(_CCCL_COMPILER_NVHPC)
94+
#elif _CCCL_COMPILER(NVHPC)
9595
# define _CCCL_SUPPRESS_DEPRECATED_PUSH \
9696
_CCCL_DIAG_PUSH \
9797
_CCCL_DIAG_SUPPRESS_NVHPC(deprecated_entity)
@@ -101,11 +101,11 @@
101101
_CCCL_DIAG_PUSH \
102102
_CCCL_DIAG_SUPPRESS_MSVC(4996)
103103
# define _CCCL_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP
104-
#else // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER_ICC && && !_CCCL_COMPILER_GCC && !_CCCL_COMPILER_NVHPC &&
104+
#else // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER_ICC && && !_CCCL_COMPILER_GCC && !_CCCL_COMPILER(NVHPC) &&
105105
// !_CCCL_COMPILER_MSVC
106106
# define _CCCL_SUPPRESS_DEPRECATED_PUSH
107107
# define _CCCL_SUPPRESS_DEPRECATED_POP
108-
#endif // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER_ICC && && !_CCCL_COMPILER_GCC && !_CCCL_COMPILER_NVHPC &&
108+
#endif // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER_ICC && && !_CCCL_COMPILER_GCC && !_CCCL_COMPILER(NVHPC) &&
109109
// !_CCCL_COMPILER_MSVC
110110

111111
// Enable us to selectively silence cuda compiler warnings
@@ -121,7 +121,7 @@
121121
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING) _CCCL_PRAGMA(nv_diagnostic push) _CCCL_PRAGMA(nv_diag_suppress _WARNING)
122122
# define _CCCL_NV_DIAG_DEFAULT(_WARNING) _CCCL_PRAGMA(nv_diagnostic pop)
123123
# endif // !_CCCL_COMPILER_MSVC
124-
# elif defined(_CCCL_COMPILER_NVHPC)
124+
# elif _CCCL_COMPILER(NVHPC)
125125
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING) _CCCL_PRAGMA(diagnostic push) _CCCL_PRAGMA(diag_suppress _WARNING)
126126
# define _CCCL_NV_DIAG_DEFAULT(_WARNING) _CCCL_PRAGMA(diagnostic pop)
127127
# else // ^^^ __NVCC_DIAG_PRAGMA_SUPPORT__ ^^^ / vvv !__NVCC_DIAG_PRAGMA_SUPPORT__ vvv

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <cuda/std/__cccl/is_non_narrowing_convertible.h> // IWYU pragma: export
1616

1717
// Enforce that cccl headers are treated as system headers
18-
#if defined(_CCCL_COMPILER_GCC) || defined(_CCCL_COMPILER_NVHPC) || defined(_CCCL_COMPILER_ICC)
18+
#if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || defined(_CCCL_COMPILER_ICC)
1919
# define _CCCL_FORCE_SYSTEM_HEADER_GCC
2020
#elif defined(_CCCL_COMPILER_CLANG)
2121
# define _CCCL_FORCE_SYSTEM_HEADER_CLANG
@@ -27,7 +27,7 @@
2727
#if !defined(_CCCL_NO_SYSTEM_HEADER) \
2828
&& !(defined(_CCCL_COMPILER_MSVC) && defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING)) \
2929
&& !defined(_CCCL_COMPILER_NVRTC) && !defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER)
30-
# if defined(_CCCL_COMPILER_GCC) || defined(_CCCL_COMPILER_NVHPC) || defined(_CCCL_COMPILER_ICC)
30+
# if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || defined(_CCCL_COMPILER_ICC)
3131
# define _CCCL_IMPLICIT_SYSTEM_HEADER_GCC
3232
# elif defined(_CCCL_COMPILER_CLANG)
3333
# define _CCCL_IMPLICIT_SYSTEM_HEADER_CLANG

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232

3333
// For unknown reasons, nvc++ need to selectively disable this warning
3434
// We do not want to use our usual macro because that would have push / pop semantics
35-
#if defined(_CCCL_COMPILER_NVHPC)
35+
#if _CCCL_COMPILER(NVHPC)
3636
# pragma nv_diag_suppress 1407
37-
#endif // _CCCL_COMPILER_NVHPC
37+
#endif // _CCCL_COMPILER(NVHPC)
3838

3939
// Enable us to hide kernels
4040
#if defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC)
@@ -74,7 +74,7 @@
7474

7575
#if defined(_CCCL_COMPILER_ICC) // ICC has issues with visibility attributes on symbols with internal linkage
7676
# define _CCCL_HIDE_FROM_ABI inline
77-
#elif defined(_CCCL_COMPILER_NVHPC) // NVHPC has issues with visibility attributes on symbols with internal linkage
77+
#elif _CCCL_COMPILER(NVHPC) // NVHPC has issues with visibility attributes on symbols with internal linkage
7878
# define _CCCL_HIDE_FROM_ABI inline
7979
#else // ^^^ _CCCL_COMPILER_ICC ^^^ / vvv !_CCCL_COMPILER_ICC vvv
8080
# define _CCCL_HIDE_FROM_ABI _CCCL_VISIBILITY_HIDDEN _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION inline

libcudacxx/include/cuda/std/__concepts/swappable.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ template <class _Tp>
8383
_LIBCUDACXX_CONCEPT __exchangeable = _LIBCUDACXX_FRAGMENT(__exchangeable_, _Tp);
8484
# endif // _CCCL_STD_VER < 2020
8585

86-
# if _CCCL_STD_VER > 2017 && !defined(_CCCL_COMPILER_NVHPC) // nvbug4051640
86+
# if _CCCL_STD_VER > 2017 && !_CCCL_COMPILER(NVHPC) // nvbug4051640
8787
struct __fn;
8888

8989
_CCCL_NV_DIAG_SUPPRESS(2642)
@@ -96,7 +96,7 @@ _CCCL_NV_DIAG_DEFAULT(2642)
9696
# else
9797
template <class _Tp, class _Up, size_t _Size, class = void>
9898
_CCCL_INLINE_VAR constexpr bool __swappable_arrays = false;
99-
# endif // _CCCL_STD_VER < 2020 || defined(_CCCL_COMPILER_NVHPC)
99+
# endif // _CCCL_STD_VER < 2020 || _CCCL_COMPILER(NVHPC)
100100

101101
template <class _Tp, class _Up, class = void>
102102
_CCCL_INLINE_VAR constexpr bool __noexcept_swappable_arrays = false;
@@ -136,7 +136,7 @@ struct __fn
136136
}
137137
};
138138

139-
# if _CCCL_STD_VER < 2020 || defined(_CCCL_COMPILER_NVHPC)
139+
# if _CCCL_STD_VER < 2020 || _CCCL_COMPILER(NVHPC)
140140
template <class _Tp, class _Up, class _Size>
141141
_LIBCUDACXX_CONCEPT_FRAGMENT(
142142
__swappable_arrays_,
@@ -148,7 +148,7 @@ _LIBCUDACXX_CONCEPT_FRAGMENT(
148148
template <class _Tp, class _Up, size_t _Size>
149149
_CCCL_INLINE_VAR constexpr bool __swappable_arrays<_Tp, _Up, _Size, void_t<type_identity_t<_Tp>>> =
150150
_LIBCUDACXX_FRAGMENT(__swappable_arrays_, _Tp, _Up, _CUDA_VSTD::integral_constant<size_t, _Size>);
151-
# endif // _CCCL_STD_VER < 2020 || defined(_CCCL_COMPILER_NVHPC)
151+
# endif // _CCCL_STD_VER < 2020 || _CCCL_COMPILER(NVHPC)
152152

153153
template <class _Tp, class _Up>
154154
_CCCL_INLINE_VAR constexpr bool __noexcept_swappable_arrays<_Tp, _Up, void_t<type_identity_t<_Tp>>> =

libcudacxx/include/cuda/std/detail/libcxx/include/__config

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ extern "C++" {
4646
# error libcu++ requires C++11 or later
4747
# endif
4848

49-
# if (defined(_CCCL_COMPILER_NVHPC) && defined(__linux__)) || defined(_CCCL_COMPILER_NVRTC)
49+
# if (_CCCL_COMPILER(NVHPC) && defined(__linux__)) || defined(_CCCL_COMPILER_NVRTC)
5050
# ifndef __ELF__
5151
# define __ELF__
5252
# endif // !__ELF__
@@ -424,7 +424,7 @@ typedef __char32_t char32_t;
424424

425425
# define _LIBCUDACXX_HAS_NO_VECTOR_EXTENSION
426426

427-
# elif defined(_CCCL_COMPILER_NVRTC) || defined(_CCCL_COMPILER_NVHPC)
427+
# elif defined(_CCCL_COMPILER_NVRTC) || _CCCL_COMPILER(NVHPC)
428428

429429
# define _LIBCUDACXX_DISABLE_EXTENSION_WARNING
430430

@@ -748,14 +748,14 @@ typedef unsigned int char32_t;
748748
# define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
749749
# elif defined(_CCCL_COMPILER_GCC)
750750
# define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
751-
# elif defined(_CCCL_COMPILER_NVHPC)
751+
# elif _CCCL_COMPILER(NVHPC)
752752
# define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
753753
# elif defined(_CCCL_COMPILER_MSVC)
754754
# define _LIBCUDACXX_HAS_MSVC_ATOMIC_IMPL
755755
# endif
756756

757757
// CUDA Atomics supersede host atomics in order to insert the host/device dispatch layer
758-
# if defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_COMPILER_NVRTC) || defined(_CCCL_COMPILER_NVHPC) \
758+
# if defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_COMPILER_NVRTC) || _CCCL_COMPILER(NVHPC) \
759759
|| defined(_CCCL_CUDACC)
760760
# define _LIBCUDACXX_HAS_CUDA_ATOMIC_IMPL
761761
# endif

libcudacxx/include/cuda/std/detail/libcxx/include/cmath

+2-2
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ long double truncl(long double x);
314314
# include <math.h>
315315
#endif // !_CCCL_COMPILER_NVRTC
316316

317-
#if defined(_CCCL_COMPILER_NVHPC)
317+
#if _CCCL_COMPILER(NVHPC)
318318
# include <cmath>
319-
#endif // _CCCL_COMPILER_NVHPC
319+
#endif // _CCCL_COMPILER(NVHPC)
320320

321321
#include <cuda/std/limits>
322322
#include <cuda/std/type_traits>

0 commit comments

Comments
 (0)