Skip to content

Commit

Permalink
Move _CCCL_COMPILER_ICC to the new macro
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Nov 17, 2024
1 parent 2453b20 commit e059715
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 42 deletions.
4 changes: 2 additions & 2 deletions cub/cub/util_macro.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ _CCCL_DIAG_SUPPRESS_CLANG("-Wattributes")
# if !defined(_CCCL_CUDA_COMPILER_NVHPC)
_CCCL_DIAG_SUPPRESS_NVHPC(attribute_requires_external_linkage)
# endif // !_CCCL_CUDA_COMPILER_NVHPC
# if defined(_CCCL_COMPILER_ICC)
# if _CCCL_COMPILER(ICC)
# pragma nv_diag_suppress 1407 // the "__visibility__" attribute can only appear on functions and
// variables with external linkage'
# pragma warning(disable : 1890) // the "__visibility__" attribute can only appear on functions and
// variables with external linkage'
# endif // _CCCL_COMPILER_ICC
# endif // _CCCL_COMPILER(ICC)
#endif // !CUB_DISABLE_KERNEL_VISIBILITY_WARNING_SUPPRESSION

#ifndef CUB_DEFINE_KERNEL_GETTER
Expand Down
2 changes: 1 addition & 1 deletion cub/cub/util_type.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ CUB_NAMESPACE_BEGIN
# endif // !defined(__CUDACC_RTC_INT128__)
# else // !defined(__CUDACC_RTC__)
# if _CCCL_CUDACC_AT_LEAST(11, 5)
# if defined(_CCCL_COMPILER_GCC) || defined(_CCCL_COMPILER_CLANG) || defined(_CCCL_COMPILER_ICC) \
# if defined(_CCCL_COMPILER_GCC) || defined(_CCCL_COMPILER_CLANG) || _CCCL_COMPILER(ICC) \
|| _CCCL_COMPILER(NVHPC)
# define CUB_IS_INT128_ENABLED 1
# endif // GCC || CLANG || ICC || NVHPC
Expand Down
6 changes: 3 additions & 3 deletions cudax/include/cuda/experimental/__detail/config.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
// two attributes:
// - `_CUDAX_API` declares the function host/device and hides the symbol from the ABI
// - `_CUDAX_TRIVIAL_API` does the same while also forcing inlining and hiding the function from debuggers
#if defined(_CCCL_COMPILER_ICC) // ICC has issues with visibility attributes on symbols with internal linkage
#if _CCCL_COMPILER(ICC) // ICC has issues with visibility attributes on symbols with internal linkage
# define _CUDAX_API _CCCL_HOST_DEVICE
# define _CUDAX_HOST_API _CCCL_HOST
# define _CUDAX_DEVICE_API _CCCL_DEVICE
#else // ^^^ _CCCL_COMPILER_ICC ^^^ / vvv !_CCCL_COMPILER_ICC vvv
#else // ^^^ _CCCL_COMPILER(ICC) ^^^ / vvv !_CCCL_COMPILER(ICC) vvv
# define _CUDAX_API _CCCL_HOST_DEVICE _CCCL_VISIBILITY_HIDDEN _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
# define _CUDAX_HOST_API _CCCL_HOST _CCCL_VISIBILITY_HIDDEN _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
# define _CUDAX_DEVICE_API _CCCL_DEVICE _CCCL_VISIBILITY_HIDDEN _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
#endif // !_CCCL_COMPILER_ICC
#endif // !_CCCL_COMPILER(ICC)

// _CUDAX_TRIVIAL_API force-inlines a function, marks its visibility as hidden, and causes debuggers to skip it.
// This is useful for trivial internal functions that do dispatching or other plumbing work. It is particularly
Expand Down
6 changes: 3 additions & 3 deletions libcudacxx/include/cuda/std/__cccl/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ _CCCL_HOST_DEVICE
}
# endif // NDEBUG
// ICC cannot deal with `__builtin_expect` in the constexpr evaluator, so just drop it
# if defined(_CCCL_COMPILER_ICC)
# if _CCCL_COMPILER(ICC)
# define _CCCL_ASSERT_IMPL_HOST(expression, message) \
static_cast<bool>(expression) ? (void) 0 : __assert_fail(message, __FILE__, __LINE__, __func__);
# else // ^^^ _CCCL_COMPILER_ICC ^^^ / vvv !_CCCL_COMPILER_ICC vvv
# else // ^^^ _CCCL_COMPILER(ICC) ^^^ / vvv !_CCCL_COMPILER(ICC) vvv
# define _CCCL_ASSERT_IMPL_HOST(expression, message) \
_CCCL_BUILTIN_EXPECT(static_cast<bool>(expression), 1) \
? (void) 0 : __assert_fail(message, __FILE__, __LINE__, __func__)
# endif // !_CCCL_COMPILER_ICC
# endif // !_CCCL_COMPILER(ICC)
#endif // !MSVC STL

//! Use custom implementations with nvcc on device and the host ones with clang-cuda and nvhpc
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/__cccl/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// Determine the host compiler and its version
#if defined(__INTEL_COMPILER)
# define _CCCL_COMPILER_ICC
# define _CCCL_COMPILER_ICC 1
# ifndef CCCL_SUPPRESS_ICC_DEPRECATION_WARNING
# warning \
"Support for the Intel C++ Compiler Classic is deprecated and will eventually be removed. Define CCCL_SUPPRESS_ICC_DEPRECATION_WARNING to suppress this warning"
Expand Down
10 changes: 5 additions & 5 deletions libcudacxx/include/cuda/std/__cccl/diagnostic.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# define _CCCL_DIAG_SUPPRESS_NVHPC(str)
# define _CCCL_DIAG_SUPPRESS_MSVC(str)
# define _CCCL_DIAG_SUPPRESS_ICC(str)
#elif defined(_CCCL_COMPILER_ICC)
#elif _CCCL_COMPILER(ICC)
# define _CCCL_DIAG_PUSH _CCCL_PRAGMA(GCC diagnostic push)
# define _CCCL_DIAG_POP _CCCL_PRAGMA(GCC diagnostic pop)
# define _CCCL_DIAG_SUPPRESS_CLANG(str)
Expand Down Expand Up @@ -80,7 +80,7 @@
_CCCL_DIAG_SUPPRESS_CLANG("-Wdeprecated") \
_CCCL_DIAG_SUPPRESS_CLANG("-Wdeprecated-declarations")
# define _CCCL_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP
#elif defined(_CCCL_COMPILER_ICC)
#elif _CCCL_COMPILER(ICC)
# define _CCCL_SUPPRESS_DEPRECATED_PUSH \
_CCCL_DIAG_PUSH \
_CCCL_DIAG_SUPPRESS_ICC(1478)
Expand All @@ -101,19 +101,19 @@
_CCCL_DIAG_PUSH \
_CCCL_DIAG_SUPPRESS_MSVC(4996)
# define _CCCL_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP
#else // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER_ICC && && !_CCCL_COMPILER_GCC && !_CCCL_COMPILER(NVHPC) &&
#else // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER(ICC) && && !_CCCL_COMPILER_GCC && !_CCCL_COMPILER(NVHPC) &&
// !_CCCL_COMPILER_MSVC
# define _CCCL_SUPPRESS_DEPRECATED_PUSH
# define _CCCL_SUPPRESS_DEPRECATED_POP
#endif // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER_ICC && && !_CCCL_COMPILER_GCC && !_CCCL_COMPILER(NVHPC) &&
#endif // !_CCCL_COMPILER_CLANG && !_CCCL_COMPILER(ICC) && && !_CCCL_COMPILER_GCC && !_CCCL_COMPILER(NVHPC) &&
// !_CCCL_COMPILER_MSVC

// Enable us to selectively silence cuda compiler warnings
#if defined(_CCCL_CUDA_COMPILER)
# if defined(_CCCL_CUDA_COMPILER_CLANG)
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING)
# define _CCCL_NV_DIAG_DEFAULT(_WARNING)
# elif defined(__NVCC_DIAG_PRAGMA_SUPPORT__) || defined(_CCCL_COMPILER_ICC)
# elif defined(__NVCC_DIAG_PRAGMA_SUPPORT__) || _CCCL_COMPILER(ICC)
# if defined(_CCCL_COMPILER_MSVC)
# define _CCCL_NV_DIAG_SUPPRESS(_WARNING) _CCCL_PRAGMA(nv_diag_suppress _WARNING)
# define _CCCL_NV_DIAG_DEFAULT(_WARNING) _CCCL_PRAGMA(nv_diag_default _WARNING)
Expand Down
4 changes: 2 additions & 2 deletions libcudacxx/include/cuda/std/__cccl/rtti.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# define _CCCL_NO_RTTI
# elif defined(__CUDA_ARCH__)
# define _CCCL_NO_RTTI // No RTTI in CUDA device code
# elif defined(_CCCL_COMPILER_ICC)
# elif _CCCL_COMPILER(ICC)
# if __RTTI == 0 && __INTEL_RTTI__ == 0 && __GXX_RTTI == 0 && _CPPRTTI == 0
# define _CCCL_NO_RTTI
# endif
Expand All @@ -58,7 +58,7 @@
# define _CCCL_NO_TYPEID
# elif defined(__CUDA_ARCH__)
# define _CCCL_NO_TYPEID // No typeid in CUDA device code
# elif defined(_CCCL_COMPILER_ICC)
# elif _CCCL_COMPILER(ICC)
// when emulating MSVC, typeid is available even when RTTI is disabled
# if !defined(_MSC_VER) && __RTTI == 0 && __INTEL_RTTI__ == 0 && __GXX_RTTI == 0 && _CPPRTTI == 0
# define _CCCL_NO_TYPEID
Expand Down
4 changes: 2 additions & 2 deletions libcudacxx/include/cuda/std/__cccl/system_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <cuda/std/__cccl/is_non_narrowing_convertible.h> // IWYU pragma: export

// Enforce that cccl headers are treated as system headers
#if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || defined(_CCCL_COMPILER_ICC)
#if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || _CCCL_COMPILER(ICC)
# define _CCCL_FORCE_SYSTEM_HEADER_GCC
#elif defined(_CCCL_COMPILER_CLANG)
# define _CCCL_FORCE_SYSTEM_HEADER_CLANG
Expand All @@ -27,7 +27,7 @@
#if !defined(_CCCL_NO_SYSTEM_HEADER) \
&& !(defined(_CCCL_COMPILER_MSVC) && defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING)) && !_CCCL_COMPILER(NVRTC) \
&& !defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER)
# if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || defined(_CCCL_COMPILER_ICC)
# if defined(_CCCL_COMPILER_GCC) || _CCCL_COMPILER(NVHPC) || _CCCL_COMPILER(ICC)
# define _CCCL_IMPLICIT_SYSTEM_HEADER_GCC
# elif defined(_CCCL_COMPILER_CLANG)
# define _CCCL_IMPLICIT_SYSTEM_HEADER_CLANG
Expand Down
6 changes: 3 additions & 3 deletions libcudacxx/include/cuda/std/__cccl/visibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
# define _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
#endif // !exclude_from_explicit_instantiation

#if defined(_CCCL_COMPILER_ICC) // ICC has issues with visibility attributes on symbols with internal linkage
#if _CCCL_COMPILER(ICC) // ICC has issues with visibility attributes on symbols with internal linkage
# define _CCCL_HIDE_FROM_ABI inline
#elif _CCCL_COMPILER(NVHPC) // NVHPC has issues with visibility attributes on symbols with internal linkage
# define _CCCL_HIDE_FROM_ABI inline
#else // ^^^ _CCCL_COMPILER_ICC ^^^ / vvv !_CCCL_COMPILER_ICC vvv
#else // ^^^ _CCCL_COMPILER(ICC) ^^^ / vvv !_CCCL_COMPILER(ICC) vvv
# define _CCCL_HIDE_FROM_ABI _CCCL_VISIBILITY_HIDDEN _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION inline
#endif // !_CCCL_COMPILER_ICC
#endif // !_CCCL_COMPILER(ICC)

//! Defined here to supress any warnings from the definition
#define _LIBCUDACXX_HIDE_FROM_ABI _CCCL_HIDE_FROM_ABI _CCCL_HOST_DEVICE
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/detail/libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ typedef unsigned int char32_t;
// TODO: Support C11 Atomics?
// #if _CCCL_HAS_FEATURE(cxx_atomic) || __has_extension(c_atomic) || _CCCL_HAS_KEYWORD(_Atomic)
// # define _LIBCUDACXX_HAS_C_ATOMIC_IMP
# if defined(_CCCL_COMPILER_ICC)
# if _CCCL_COMPILER(ICC)
# define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
# elif defined(_CCCL_COMPILER_CLANG)
# define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
Expand Down
18 changes: 9 additions & 9 deletions libcudacxx/include/cuda/std/detail/libcxx/include/cmath
Original file line number Diff line number Diff line change
Expand Up @@ -756,11 +756,11 @@ _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_fmax(_A1 __x, _A1 __y) noexcept
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX float __constexpr_fmax(float __x, float __y) noexcept
{
# if defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(_LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS)
# if defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
# if _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
if (false)
# else // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
# else // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
if (_CCCL_BUILTIN_IS_CONSTANT_EVALUATED())
# endif // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
# endif // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
{
if (__constexpr_isnan(__x))
{
Expand All @@ -779,11 +779,11 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX float __constexpr_fmax(f
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX double __constexpr_fmax(double __x, double __y) noexcept
{
# if defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(_LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS)
# if defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
# if _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
if (false)
# else // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
# else // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
if (_CCCL_BUILTIN_IS_CONSTANT_EVALUATED())
# endif // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
# endif // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
{
if (__constexpr_isnan(__x))
{
Expand All @@ -803,11 +803,11 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX long double
__constexpr_fmax(long double __x, long double __y) noexcept
{
# if defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED) && !defined(_LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS)
# if defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
# if _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
if (false)
# else // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
# else // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
if (_CCCL_BUILTIN_IS_CONSTANT_EVALUATED())
# endif // defined(_CCCL_COMPILER_ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
# endif // _CCCL_COMPILER(ICC) && _NV_ISEMPTY(_CCCL_CONSTEXPR_CXX14_COMPLEX)
{
if (__constexpr_isnan(__x))
{
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/test/libcudacxx/cuda/type_list.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <cuda/std/__utility/integer_sequence.h>
#include <cuda/std/__utility/pair.h>

#if defined(_CCCL_COMPILER_ICC) || defined(_CCCL_CUDA_COMPILER_NVCC) || _CCCL_COMPILER(NVRTC) \
#if _CCCL_COMPILER(ICC) || defined(_CCCL_CUDA_COMPILER_NVCC) || _CCCL_COMPILER(NVRTC) \
|| defined(_CCCL_CUDA_COMPILER_CLANG)
// These compilers have trouble making substitution failures during
// alias template instantiation non-fatal.
Expand Down
4 changes: 2 additions & 2 deletions thrust/testing/async_copy.cu
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ struct test_async_copy_counting_iterator_input_to_host_vector

ASSERT_EQUAL(d0, d1);

# if defined(_CCCL_COMPILER_ICC)
# if _CCCL_COMPILER(ICC)
// ICC fails this for some unknown reason - see #1468.
KNOWN_FAILURE;
# endif
# endif // _CCCL_COMPILER(ICC)
}
};
};
Expand Down
2 changes: 1 addition & 1 deletion thrust/testing/scan.cu
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void TestScanSimple()
// The issue doesn't happen with opts disabled, or on other compilers.
// Printing the intermediate sum each iteration "fixes" the issue,
// so likely a bad optimization.
#if defined(_CCCL_COMPILER_ICC)
#if _CCCL_COMPILER(ICC)
if (std::is_same<T, custom_numeric>::value)
{
return;
Expand Down
10 changes: 5 additions & 5 deletions thrust/thrust/complex.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,18 @@ struct complex
private:
#if defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7)
struct __align__(sizeof(T) * 2) storage
#elif defined(_CCCL_COMPILER_ICC)
#elif _CCCL_COMPILER(ICC)
struct storage
#else // !(defined(_CCCL_COMPILER_ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7)))
#else // !(_CCCL_COMPILER(ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7)))
struct alignas(sizeof(T) * 2) storage
#endif // !(defined(_CCCL_COMPILER_ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7)))
#endif // !(_CCCL_COMPILER(ICC) || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 7)))
{
T x;
T y;
}
#ifdef _CCCL_COMPILER_ICC
#if _CCCL_COMPILER(ICC)
__attribute__((aligned(sizeof(T) * 2)))
#endif // _CCCL_COMPILER_ICC
#endif // _CCCL_COMPILER(ICC)
;
storage data;
};
Expand Down
2 changes: 1 addition & 1 deletion thrust/thrust/detail/config/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
# define THRUST_MSVC_VERSION _CCCL_MSVC_VERSION
//! deprecated [Since 2.7]
# define THRUST_MSVC_VERSION_FULL _CCCL_MSVC_VERSION_FULL
#elif defined(_CCCL_COMPILER_ICC)
#elif _CCCL_COMPILER(ICC)
//! deprecated [Since 2.7]
# define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_INTEL
#elif defined(_CCCL_COMPILER_CLANG)
Expand Down

0 comments on commit e059715

Please sign in to comment.