From bc45573d680911f18aa8e8c0a970ef8b0742ab9c Mon Sep 17 00:00:00 2001 From: David Bayer <48736217+davebayer@users.noreply.github.com> Date: Fri, 22 Nov 2024 08:51:57 +0100 Subject: [PATCH] move msvc compiler macros to new version (#2885) Co-authored-by: Michael Schellenberger Costa Co-authored-by: Bernhard Manfred Gruber Co-authored-by: Eric Niebler --- cub/cub/detail/nvtx.cuh | 2 +- cub/cub/util_compiler.cuh | 8 +- cub/cub/util_cpp_dialect.cuh | 6 +- cub/cub/util_deprecated.cuh | 2 +- .../catch2_test_device_for_each_in_extents.cu | 6 +- cub/test/catch2_test_device_transform.cu | 4 +- cub/test/test_warning_suppression.cuh | 2 +- cudax/examples/stf/fdtd_mgpu.cu | 8 +- .../cuda/experimental/__async/lazy.cuh | 2 +- .../cuda/experimental/__async/meta.cuh | 2 +- .../cuda/experimental/__async/tuple.cuh | 2 +- .../cuda/experimental/__async/variant.cuh | 2 +- .../uninitialized_async_buffer.cuh | 5 +- .../__container/uninitialized_buffer.cuh | 5 +- .../cuda/experimental/__device/device.cuh | 2 +- .../__memory_resource/any_resource.cuh | 2 +- .../__memory_resource/device_memory_pool.cuh | 4 +- .../device_memory_resource.cuh | 4 +- .../__memory_resource/shared_resource.cuh | 2 +- .../experimental/__stf/graph/graph_task.cuh | 8 +- .../__stf/internal/backend_ctx.cuh | 8 +- .../places/exec/host/callback_queues.cuh | 4 +- .../experimental/__stf/stream/stream_ctx.cuh | 4 +- .../cuda/experimental/__stf/utility/core.cuh | 2 +- .../experimental/__stf/utility/traits.cuh | 12 +- cudax/test/stf/dot/basic.cu | 4 +- cudax/test/stf/dot/graph_print_to_dot.cu | 4 +- cudax/test/stf/dot/with_events.cu | 4 +- cudax/test/stf/error_checks/ctx_mismatch.cu | 6 +- .../error_checks/data_interface_mismatch.cu | 6 +- .../test/stf/error_checks/double_finalize.cu | 6 +- cudax/test/stf/error_checks/erase_frozen.cu | 6 +- .../error_checks/misformed_tasks_dbl_end.cu | 6 +- .../error_checks/misformed_tasks_dbl_start.cu | 6 +- .../test/stf/error_checks/non_managed_data.cu | 6 +- .../stf/error_checks/slice_check_bounds.cu | 6 +- .../stf/error_checks/uninitialized_data.cu | 6 +- .../stf/error_checks/unsatisfiable_spec.cu | 6 +- cudax/test/stf/error_checks/write_frozen.cu | 6 +- cudax/test/stf/parallel_for/fdtd.cu | 8 +- cudax/test/stf/reclaiming/graph.cu | 8 +- cudax/test/stf/stress/task_bench.cu | 8 +- cudax/test/stf/tools/auto_dump/auto_dump.cu | 4 +- .../device_memory_resource.h | 4 +- .../cuda/__memory_resource/get_property.h | 4 +- .../managed_memory_resource.h | 4 +- .../pinned_memory_resource.h | 4 +- .../cuda/__memory_resource/properties.h | 4 +- .../include/cuda/__memory_resource/resource.h | 4 +- .../cuda/__memory_resource/resource_ref.h | 4 +- .../std/__algorithm/iterator_operations.h | 4 +- .../std/__algorithm/ranges_iterator_concept.h | 4 +- .../include/cuda/std/__atomic/platform.h | 2 +- .../std/__atomic/platform/msvc_to_builtins.h | 4 +- libcudacxx/include/cuda/std/__bit/clz.h | 8 +- libcudacxx/include/cuda/std/__bit/ctz.h | 8 +- libcudacxx/include/cuda/std/__bit/popc.h | 8 +- libcudacxx/include/cuda/std/__cccl/assert.h | 8 +- .../include/cuda/std/__cccl/attributes.h | 10 +- libcudacxx/include/cuda/std/__cccl/builtin.h | 109 ++++++++---------- libcudacxx/include/cuda/std/__cccl/compiler.h | 26 ++--- .../include/cuda/std/__cccl/diagnostic.h | 26 ++--- libcudacxx/include/cuda/std/__cccl/dialect.h | 6 +- .../include/cuda/std/__cccl/exceptions.h | 4 +- libcudacxx/include/cuda/std/__cccl/rtti.h | 4 +- .../include/cuda/std/__cccl/system_header.h | 9 +- .../include/cuda/std/__cccl/unreachable.h | 8 +- .../include/cuda/std/__cccl/visibility.h | 14 +-- .../cuda/std/__concepts/concept_macros.h | 6 +- .../cuda/std/__concepts/convertible_to.h | 8 +- .../cuda/std/__concepts/destructible.h | 6 +- .../include/cuda/std/__concepts/swappable.h | 8 +- libcudacxx/include/cuda/std/__fwd/get.h | 4 +- libcudacxx/include/cuda/std/__fwd/subrange.h | 4 +- .../include/cuda/std/__iterator/concepts.h | 6 +- .../include/cuda/std/__iterator/distance.h | 4 +- .../cuda/std/__iterator/iterator_traits.h | 6 +- .../cuda/std/__iterator/move_iterator.h | 20 ++-- libcudacxx/include/cuda/std/__iterator/next.h | 4 +- libcudacxx/include/cuda/std/__iterator/prev.h | 4 +- .../cuda/std/__iterator/reverse_iterator.h | 6 +- .../std/__iterator/unreachable_sentinel.h | 8 +- .../cuda/std/__memory/assume_aligned.h | 4 +- libcudacxx/include/cuda/std/__ranges/access.h | 4 +- .../include/cuda/std/__ranges/concepts.h | 4 +- .../include/cuda/std/__ranges/dangling.h | 4 +- libcudacxx/include/cuda/std/__ranges/data.h | 4 +- libcudacxx/include/cuda/std/__ranges/empty.h | 4 +- libcudacxx/include/cuda/std/__ranges/rbegin.h | 4 +- libcudacxx/include/cuda/std/__ranges/rend.h | 4 +- libcudacxx/include/cuda/std/__ranges/size.h | 4 +- .../include/cuda/std/__ranges/subrange.h | 4 +- .../include/cuda/std/__ranges/unwrap_end.h | 4 +- .../cuda/std/__ranges/view_interface.h | 4 +- libcudacxx/include/cuda/std/__ranges/views.h | 4 +- .../std/__tuple_dir/structured_bindings.h | 4 +- .../include/cuda/std/__tuple_dir/tuple_like.h | 4 +- .../cuda/std/__type_traits/common_reference.h | 6 +- .../cuda/std/__type_traits/common_type.h | 6 +- .../cuda/std/__type_traits/disjunction.h | 4 +- .../cuda/std/__type_traits/is_convertible.h | 4 +- .../std/__type_traits/is_primary_template.h | 6 +- .../cuda/std/__type_traits/type_list.h | 6 +- .../include/cuda/std/__type_traits/type_set.h | 2 +- .../include/cuda/std/__utility/auto_cast.h | 2 +- .../include/cuda/std/__utility/declval.h | 3 +- libcudacxx/include/cuda/std/bitset | 6 +- .../cuda/std/detail/libcxx/include/__config | 24 ++-- .../cuda/std/detail/libcxx/include/climits | 2 +- .../cuda/std/detail/libcxx/include/cmath | 18 +-- .../cuda/std/detail/libcxx/include/limits | 2 +- .../cuda/std/detail/libcxx/include/span | 12 +- .../cuda/std/detail/libcxx/include/variant | 4 +- libcudacxx/include/cuda/std/inplace_vector | 52 ++++----- libcudacxx/include/cuda/std/version | 4 +- .../support.srcloc/general.pass.cpp | 8 +- .../bitset.members/to_ullong.pass.cpp | 2 +- .../bitset.members/to_ulong.pass.cpp | 2 +- libcudacxx/test/support/test_macros.h | 6 +- thrust/testing/async_sort.cu | 2 +- thrust/testing/cuda/transform.cu | 4 +- thrust/testing/functional.cu | 2 +- thrust/testing/set_difference.cu | 2 +- thrust/testing/set_intersection.cu | 2 +- thrust/testing/vector_manipulation.cu | 2 +- thrust/thrust/detail/config/compiler.h | 8 +- thrust/thrust/detail/config/compiler_fence.h | 4 +- thrust/thrust/detail/config/cpp_dialect.h | 6 +- thrust/thrust/detail/config/deprecated.h | 2 +- thrust/thrust/iterator/permutation_iterator.h | 8 +- thrust/thrust/iterator/reverse_iterator.h | 6 +- thrust/thrust/iterator/transform_iterator.h | 8 +- thrust/thrust/iterator/zip_iterator.h | 6 +- thrust/thrust/optional.h | 4 +- thrust/thrust/system/detail/error_code.inl | 8 +- .../thrust/system/detail/error_condition.inl | 8 +- thrust/thrust/system/error_code.h | 16 +-- .../type_traits/is_contiguous_iterator.h | 2 +- 138 files changed, 458 insertions(+), 481 deletions(-) diff --git a/cub/cub/detail/nvtx.cuh b/cub/cub/detail/nvtx.cuh index 3bda5e596f3..35fae565b0b 100644 --- a/cub/cub/detail/nvtx.cuh +++ b/cub/cub/detail/nvtx.cuh @@ -96,7 +96,7 @@ CUB_NAMESPACE_END # define CUB_DETAIL_NVTX_RANGE_SCOPE(name) CUB_DETAIL_NVTX_RANGE_SCOPE_IF(true, name) # else // NVTX3_CPP_DEFINITIONS_V1_0 -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) # pragma message( \ "warning: nvtx3.hpp is available but does not define the V1 API. This is odd. Please open a GitHub issue at: https://github.com/NVIDIA/cccl/issues.") # else diff --git a/cub/cub/util_compiler.cuh b/cub/cub/util_compiler.cuh index 6385e795045..2110268617c 100644 --- a/cub/cub/util_compiler.cuh +++ b/cub/cub/util_compiler.cuh @@ -66,13 +66,13 @@ #define CUB_DEVICE_COMPILER_CLANG 4 // figure out which host compiler we're using -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) //! deprecated [Since 2.7] # define CUB_HOST_COMPILER CUB_HOST_COMPILER_MSVC //! deprecated [Since 2.7] -# define CUB_MSVC_VERSION _CCCL_MSVC_VERSION +# define CUB_MSVC_VERSION _MSC_VER //! deprecated [Since 2.7] -# define CUB_MSVC_VERSION_FULL _CCCL_MSVC_VERSION_FULL +# define CUB_MSVC_VERSION_FULL _MSC_FULL_VER #elif _CCCL_COMPILER(CLANG) //! deprecated [Since 2.7] # define CUB_HOST_COMPILER CUB_HOST_COMPILER_CLANG @@ -89,7 +89,7 @@ #if defined(_CCCL_CUDA_COMPILER_NVCC) || defined(_CCCL_CUDA_COMPILER_NVHPC) //! deprecated [Since 2.7] # define CUB_DEVICE_COMPILER CUB_DEVICE_COMPILER_NVCC -#elif defined(_CCCL_COMPILER_MSVC) +#elif _CCCL_COMPILER(MSVC) //! deprecated [Since 2.7] # define CUB_DEVICE_COMPILER CUB_DEVICE_COMPILER_MSVC #elif _CCCL_COMPILER(GCC) diff --git a/cub/cub/util_cpp_dialect.cuh b/cub/cub/util_cpp_dialect.cuh index 6f54239bf84..e2affdb3304 100644 --- a/cub/cub/util_cpp_dialect.cuh +++ b/cub/cub/util_cpp_dialect.cuh @@ -80,7 +80,7 @@ # define CUB_CPP_DIALECT _CCCL_STD_VER // Define CUB_COMPILER_DEPRECATION macro: -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) # define CUB_COMP_DEPR_IMPL(msg) _CCCL_PRAGMA(message(__FILE__ ":" _CCCL_TO_STRING(__LINE__) ": warning: " #msg)) # else // clang / gcc: # define CUB_COMP_DEPR_IMPL(msg) _CCCL_PRAGMA(GCC warning #msg) @@ -101,10 +101,10 @@ CUB_COMPILER_DEPRECATION(GCC 5.0); # elif _CCCL_COMPILER(CLANG, <, 7) CUB_COMPILER_DEPRECATION(Clang 7.0); -# elif defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION < 1910 +# elif _CCCL_COMPILER(MSVC, <, 19, 10) // <2017. Hard upgrade message: CUB_COMPILER_DEPRECATION(MSVC 2019(19.20 / 16.0 / 14.20)); -# elif defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION < 1920 +# elif _CCCL_COMPILER(MSVC2017) // >=2017, <2019. Soft deprecation message: CUB_COMPILER_DEPRECATION_SOFT(MSVC 2019(19.20 / 16.0 / 14.20), MSVC 2017); # endif diff --git a/cub/cub/util_deprecated.cuh b/cub/cub/util_deprecated.cuh index 250c3f53b16..c227d4309b9 100644 --- a/cub/cub/util_deprecated.cuh +++ b/cub/cub/util_deprecated.cuh @@ -55,7 +55,7 @@ #elif _CCCL_STD_VER >= 2014 # define CUB_DEPRECATED [[deprecated]] # define CUB_DEPRECATED_BECAUSE(MSG) [[deprecated(MSG)]] -#elif defined(_CCCL_COMPILER_MSVC) +#elif _CCCL_COMPILER(MSVC) # define CUB_DEPRECATED __declspec(deprecated) # define CUB_DEPRECATED_BECAUSE(MSG) __declspec(deprecated(MSG)) #elif _CCCL_COMPILER(CLANG) diff --git a/cub/test/catch2_test_device_for_each_in_extents.cu b/cub/test/catch2_test_device_for_each_in_extents.cu index 51f9b7e6d37..6f11810101c 100644 --- a/cub/test/catch2_test_device_for_each_in_extents.cu +++ b/cub/test/catch2_test_device_for_each_in_extents.cu @@ -26,9 +26,9 @@ ******************************************************************************/ #include -// TODO: remove _CCCL_COMPILER_MSVC check after MSVC bug related to vector comparison is fixed: +// TODO: remove _CCCL_COMPILER(MSVC) check after MSVC bug related to vector comparison is fixed: // "error C3546: '...': there are no parameter packs available to expand" -#if __cccl_lib_mdspan && !defined(_CCCL_COMPILER_MSVC) +#if __cccl_lib_mdspan && !_CCCL_COMPILER(MSVC) # include @@ -181,4 +181,4 @@ C2H_TEST("DeviceForEachInExtents 3D dynamic", "[ForEachInExtents][dynamic][devic REQUIRE(h_output == h_output_gpu); } -#endif // __cccl_lib_mdspan && !defined(_CCCL_COMPILER_MSVC) +#endif // __cccl_lib_mdspan && !_CCCL_COMPILER(MSVC) diff --git a/cub/test/catch2_test_device_transform.cu b/cub/test/catch2_test_device_transform.cu index 4da07e330b6..db05da6c032 100644 --- a/cub/test/catch2_test_device_transform.cu +++ b/cub/test/catch2_test_device_transform.cu @@ -178,10 +178,10 @@ struct alignas(Alignment) overaligned_addable_t using overaligned_types = c2h::type_list -#ifndef _CCCL_COMPILER_MSVC // error C2719: [...] formal parameter with requested alignment of 256 won't be aligned +#if !_CCCL_COMPILER(MSVC) // error C2719: [...] formal parameter with requested alignment of 256 won't be aligned , overaligned_addable_t<256> -#endif // _CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) >; // test with types exceeding the memcpy_async and bulk copy alignments (16 and 128 bytes respectively) diff --git a/cub/test/test_warning_suppression.cuh b/cub/test/test_warning_suppression.cuh index e11d199e0a8..46c6080fed7 100644 --- a/cub/test/test_warning_suppression.cuh +++ b/cub/test/test_warning_suppression.cuh @@ -33,7 +33,7 @@ // C4127: conditional expression is constant // This can be fixed with `if constexpr` when available, but there's no way to // silence these pre-C++17. -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # if _CCCL_STD_VER < 2017 # pragma warning(disable : 4127) # endif diff --git a/cudax/examples/stf/fdtd_mgpu.cu b/cudax/examples/stf/fdtd_mgpu.cu index a9a54d1f993..d991c97f258 100644 --- a/cudax/examples/stf/fdtd_mgpu.cu +++ b/cudax/examples/stf/fdtd_mgpu.cu @@ -21,7 +21,7 @@ using namespace cuda::experimental::stf; // FIXME : MSVC has trouble with box constructors -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) void write_vtk_2D(const std::string& filename, slice Ez, double dx, double dy, double /*unused*/) { FILE* f = fopen(filename.c_str(), "w"); @@ -99,11 +99,11 @@ _CCCL_DEVICE double Source(double t, double x, double y, double z) constexpr double k = 2 * pi / wavelength; return sin(k * x - omega * t); } -#endif // !defined(_CCCL_COMPILER_MSVC) +#endif // !_CCCL_COMPILER(MSVC) int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) { -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) context ctx; // Initialize the time loop @@ -292,5 +292,5 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) }; ctx.finalize(); -#endif // !defined(_CCCL_COMPILER_MSVC) +#endif // !_CCCL_COMPILER(MSVC) } diff --git a/cudax/include/cuda/experimental/__async/lazy.cuh b/cudax/include/cuda/experimental/__async/lazy.cuh index 95f7a4a0adb..7655b658401 100644 --- a/cudax/include/cuda/experimental/__async/lazy.cuh +++ b/cudax/include/cuda/experimental/__async/lazy.cuh @@ -136,7 +136,7 @@ struct __lazy_tupl<_CUDA_VSTD::index_sequence<_Idx...>, _Ts...> : __detail::__la bool __engaged_[sizeof...(_Ts)] = {}; }; -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) template struct __mk_lazy_tuple_ { diff --git a/cudax/include/cuda/experimental/__async/meta.cuh b/cudax/include/cuda/experimental/__async/meta.cuh index dbe2d21a15a..4f2b00a9de2 100644 --- a/cudax/include/cuda/experimental/__async/meta.cuh +++ b/cudax/include/cuda/experimental/__async/meta.cuh @@ -135,7 +135,7 @@ inline constexpr bool __type_is_error<_ERROR<_What...>&> = true; // True if any of the types in _Ts... are errors; false otherwise. template inline constexpr bool __type_contains_error = -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) (__type_is_error<_Ts> || ...); #else __ustdex_unhandled_error(static_cast<_CUDA_VSTD::__type_list<_Ts...>*>(nullptr)); diff --git a/cudax/include/cuda/experimental/__async/tuple.cuh b/cudax/include/cuda/experimental/__async/tuple.cuh index 3891ec47df7..06e74e3aabc 100644 --- a/cudax/include/cuda/experimental/__async/tuple.cuh +++ b/cudax/include/cuda/experimental/__async/tuple.cuh @@ -82,7 +82,7 @@ template using __apply_result_t = decltype(__declval<_Tupl>().__apply(__declval<_Fn>(), __declval<_Tupl>(), __declval<_Us>()...)); -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) template struct __mk_tuple_ { diff --git a/cudax/include/cuda/experimental/__async/variant.cuh b/cudax/include/cuda/experimental/__async/variant.cuh index 3398cdc9717..2c8c5b1ea16 100644 --- a/cudax/include/cuda/experimental/__async/variant.cuh +++ b/cudax/include/cuda/experimental/__async/variant.cuh @@ -169,7 +169,7 @@ public: } }; -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) template struct __mk_variant_ { diff --git a/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh b/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh index 5bfd60da9d3..fb502cbbf7d 100644 --- a/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh +++ b/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh @@ -34,8 +34,7 @@ #include -#if _CCCL_STD_VER >= 2014 && !defined(_CCCL_COMPILER_MSVC_2017) \ - && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) +#if _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) //! @file //! The \c uninitialized_async_buffer class provides a typed buffer allocated in stream-order from a given memory @@ -299,6 +298,6 @@ using uninitialized_async_device_buffer = uninitialized_async_buffer<_Tp, _CUDA_ } // namespace cuda::experimental -#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER_MSVC_2017 && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE +#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017) && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE #endif //__CUDAX__CONTAINERS_UNINITIALIZED_ASYNC_BUFFER_H diff --git a/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh b/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh index 38c968d25c8..9a2f1200678 100644 --- a/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh +++ b/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh @@ -33,8 +33,7 @@ #include -#if _CCCL_STD_VER >= 2014 && !defined(_CCCL_COMPILER_MSVC_2017) \ - && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) +#if _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) //! @file //! The \c uninitialized_buffer class provides a typed buffer allocated from a given memory resource. @@ -264,6 +263,6 @@ using uninitialized_device_buffer = uninitialized_buffer<_Tp, _CUDA_VMR::device_ } // namespace cuda::experimental -#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER_MSVC_2017 && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE +#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017) && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE #endif //__CUDAX__CONTAINERS_UNINITIALIZED_BUFFER_H diff --git a/cudax/include/cuda/experimental/__device/device.cuh b/cudax/include/cuda/experimental/__device/device.cuh index 3e19bafb4e7..98db56f668e 100644 --- a/cudax/include/cuda/experimental/__device/device.cuh +++ b/cudax/include/cuda/experimental/__device/device.cuh @@ -69,7 +69,7 @@ public: using attr_result_t = typename detail::__dev_attr<_Attr>::type; #ifndef _CCCL_DOXYGEN_INVOKED // Do not document -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) // When __EDG__ is defined, std::construct_at will not permit constructing // a device object from an __emplace_device object. This is a workaround. device(detail::__emplace_device __ed) diff --git a/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh index f386853bb08..f442e56dcfe 100644 --- a/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh @@ -28,7 +28,7 @@ #endif // cuda::mr is unavable on MSVC 2017 -#if defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_COMPILER(MSVC2017) # error "The any_resource header is not supported on MSVC 2017" #endif diff --git a/cudax/include/cuda/experimental/__memory_resource/device_memory_pool.cuh b/cudax/include/cuda/experimental/__memory_resource/device_memory_pool.cuh index 4708930d8ad..c74f7d68f77 100644 --- a/cudax/include/cuda/experimental/__memory_resource/device_memory_pool.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/device_memory_pool.cuh @@ -22,7 +22,7 @@ #endif // no system header // cudaMallocAsync was introduced in CTK 11.2 -#if !defined(_CCCL_COMPILER_MSVC_2017) && _CCCL_CUDACC_AT_LEAST(11, 2) +#if !_CCCL_COMPILER(MSVC2017) && _CCCL_CUDACC_AT_LEAST(11, 2) # if defined(_CCCL_CUDA_COMPILER_CLANG) # include @@ -428,6 +428,6 @@ public: # endif // _CCCL_STD_VER >= 2014 -#endif // !_CCCL_COMPILER_MSVC_2017 && _CCCL_CUDACC_AT_LEAST(11, 2) +#endif // !_CCCL_COMPILER(MSVC2017) && _CCCL_CUDACC_AT_LEAST(11, 2) #endif // _CUDAX__MEMORY_RESOURCE_DEVICE_MEMORY_POOL diff --git a/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh index 7d54dd4f750..fffe3dea722 100644 --- a/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh @@ -22,7 +22,7 @@ #endif // no system header // cudaMallocAsync was introduced in CTK 11.2 -#if !defined(_CCCL_COMPILER_MSVC_2017) && _CCCL_CUDACC_AT_LEAST(11, 2) +#if !_CCCL_COMPILER(MSVC2017) && _CCCL_CUDACC_AT_LEAST(11, 2) # if defined(_CCCL_CUDA_COMPILER_CLANG) # include @@ -417,6 +417,6 @@ static_assert(_CUDA_VMR::resource_with= 2014 -#endif // !_CCCL_COMPILER_MSVC_2017 && _CCCL_CUDACC_AT_LEAST(11, 2) +#endif // !_CCCL_COMPILER(MSVC2017) && _CCCL_CUDACC_AT_LEAST(11, 2) #endif //_CUDAX__MEMORY_RESOURCE_CUDA_DEVICE_MEMORY_RESOURCE diff --git a/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh index e92538ae8a0..1b0a81320b1 100644 --- a/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh @@ -28,7 +28,7 @@ #endif // cuda::mr is unavable on MSVC 2017 -#if defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_COMPILER(MSVC2017) # error "The shared_resource header is not supported on MSVC 2017" #endif diff --git a/cudax/include/cuda/experimental/__stf/graph/graph_task.cuh b/cudax/include/cuda/experimental/__stf/graph/graph_task.cuh index 884abc7cdac..f10c883e2ee 100644 --- a/cudax/include/cuda/experimental/__stf/graph/graph_task.cuh +++ b/cudax/include/cuda/experimental/__stf/graph/graph_task.cuh @@ -420,11 +420,11 @@ public: return mv(*this); } -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) // TODO (miscco): figure out why MSVC is complaining about unreachable code here _CCCL_DIAG_PUSH _CCCL_DIAG_SUPPRESS_MSVC(4702) // unreachable code -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) template void operator->*(Fun&& f) @@ -518,9 +518,9 @@ public: ::std::apply(f, tuple_prepend(mv(childGraph), typed_deps())); } } -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) _CCCL_DIAG_POP -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) private: auto typed_deps() diff --git a/cudax/include/cuda/experimental/__stf/internal/backend_ctx.cuh b/cudax/include/cuda/experimental/__stf/internal/backend_ctx.cuh index ce162fc40c0..2822370c1f3 100644 --- a/cudax/include/cuda/experimental/__stf/internal/backend_ctx.cuh +++ b/cudax/include/cuda/experimental/__stf/internal/backend_ctx.cuh @@ -492,19 +492,19 @@ protected: return nullptr; } -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) _CCCL_DIAG_PUSH _CCCL_DIAG_SUPPRESS_MSVC(4702) // unreachable code -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) virtual event_list stream_to_event_list(cudaStream_t, ::std::string) const { fprintf(stderr, "Internal error.\n"); abort(); return event_list(); } -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) _CCCL_DIAG_POP -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) virtual size_t epoch() const { diff --git a/cudax/include/cuda/experimental/__stf/places/exec/host/callback_queues.cuh b/cudax/include/cuda/experimental/__stf/places/exec/host/callback_queues.cuh index 2d3036ec143..387a3594c1f 100644 --- a/cudax/include/cuda/experimental/__stf/places/exec/host/callback_queues.cuh +++ b/cudax/include/cuda/experimental/__stf/places/exec/host/callback_queues.cuh @@ -32,7 +32,7 @@ #ifndef _CCCL_DOXYGEN_INVOKED // do not document -# if !defined(_CCCL_COMPILER_MSVC) +# if !_CCCL_COMPILER(MSVC) # define STATEFUL_CALLBACKS namespace cuda::experimental::stf @@ -602,5 +602,5 @@ inline bool cudaCallbackQueueProgress(callback_queue* q, bool flag) } // end namespace cuda::experimental::stf -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) #endif // _CCCL_DOXYGEN_INVOKED do not document diff --git a/cudax/include/cuda/experimental/__stf/stream/stream_ctx.cuh b/cudax/include/cuda/experimental/__stf/stream/stream_ctx.cuh index 022179341d9..86cceb1b2d9 100644 --- a/cudax/include/cuda/experimental/__stf/stream/stream_ctx.cuh +++ b/cudax/include/cuda/experimental/__stf/stream/stream_ctx.cuh @@ -809,7 +809,7 @@ UNITTEST("movable stream_task") // FIXME : This test is causing some compiler errors with MSVC, so we disable // it on MSVC for now -# if !defined(_CCCL_COMPILER_MSVC) +# if !_CCCL_COMPILER(MSVC) UNITTEST("logical_data_untyped moveable") { using namespace cuda::experimental::stf; @@ -852,7 +852,7 @@ UNITTEST("logical_data_untyped moveable") ctx.finalize(); }; -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) # ifdef __CUDACC__ namespace reserved diff --git a/cudax/include/cuda/experimental/__stf/utility/core.cuh b/cudax/include/cuda/experimental/__stf/utility/core.cuh index 23b0ff5560f..42e68c36905 100644 --- a/cudax/include/cuda/experimental/__stf/utility/core.cuh +++ b/cudax/include/cuda/experimental/__stf/utility/core.cuh @@ -39,7 +39,7 @@ namespace cuda::experimental::stf { // Hack setenv on Windows -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) /** * @brief Sets an environment variable, mimicking the behavior of `std::setenv` on Windows. * diff --git a/cudax/include/cuda/experimental/__stf/utility/traits.cuh b/cudax/include/cuda/experimental/__stf/utility/traits.cuh index 402737a44d3..8308e56d702 100644 --- a/cudax/include/cuda/experimental/__stf/utility/traits.cuh +++ b/cudax/include/cuda/experimental/__stf/utility/traits.cuh @@ -44,11 +44,11 @@ namespace reserved template constexpr ::std::string_view type_name_IMPL() { -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) return __FUNCSIG__; -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv return __PRETTY_FUNCTION__; -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) } // Length of prefix and suffix in __PRETTY_FUNCTION__ when used with `type_name`. @@ -73,14 +73,14 @@ inline constexpr ::std::pair type_name_affixes = [] { template constexpr ::std::string_view type_name_impl() { -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) constexpr ::std::string_view p = __FUNCSIG__; // MSVC does not provide constexpr methods so we make this utility much simpler and return __FUNCSIG__ directly return p; -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv ::std::string_view p = __PRETTY_FUNCTION__; return p.substr(type_name_affixes.first, p.size() - type_name_affixes.first - type_name_affixes.second); -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) } } // namespace reserved diff --git a/cudax/test/stf/dot/basic.cu b/cudax/test/stf/dot/basic.cu index dce79545a71..b602f142a2f 100644 --- a/cudax/test/stf/dot/basic.cu +++ b/cudax/test/stf/dot/basic.cu @@ -20,7 +20,7 @@ using namespace cuda::experimental::stf; int main() { // TODO (miscco): Make it work for windows -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) // Generate a random filename int r = rand(); @@ -44,5 +44,5 @@ int main() EXPECT(access(filename, F_OK) != -1); EXPECT(unlink(filename) == 0); -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) } diff --git a/cudax/test/stf/dot/graph_print_to_dot.cu b/cudax/test/stf/dot/graph_print_to_dot.cu index 62e5abfd193..cd024f72770 100644 --- a/cudax/test/stf/dot/graph_print_to_dot.cu +++ b/cudax/test/stf/dot/graph_print_to_dot.cu @@ -22,7 +22,7 @@ __global__ void dummy() {} int main() { // TODO (miscco): Make it work for windows -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) // Generate a random filename int r = rand(); @@ -46,5 +46,5 @@ int main() EXPECT(access(filename, F_OK) != -1); EXPECT(unlink(filename) == 0); -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) } diff --git a/cudax/test/stf/dot/with_events.cu b/cudax/test/stf/dot/with_events.cu index a03425024b8..b3c636e1d69 100644 --- a/cudax/test/stf/dot/with_events.cu +++ b/cudax/test/stf/dot/with_events.cu @@ -20,7 +20,7 @@ using namespace cuda::experimental::stf; int main() { // TODO (miscco): Make it work for windows -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) // Generate a random filename int r = rand(); @@ -45,5 +45,5 @@ int main() EXPECT(access(filename, F_OK) != -1); EXPECT(unlink(filename) == 0); -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) } diff --git a/cudax/test/stf/error_checks/ctx_mismatch.cu b/cudax/test/stf/error_checks/ctx_mismatch.cu index cafa6873dec..c04d589c367 100644 --- a/cudax/test/stf/error_checks/ctx_mismatch.cu +++ b/cudax/test/stf/error_checks/ctx_mismatch.cu @@ -53,9 +53,9 @@ void run(double (&X)[n]) int main() { /* Setup an handler to catch the SIGABRT signal during the programming error */ -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -66,7 +66,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) const int n = 12; double X[n]; diff --git a/cudax/test/stf/error_checks/data_interface_mismatch.cu b/cudax/test/stf/error_checks/data_interface_mismatch.cu index 79969f390ba..ea2ada7e633 100644 --- a/cudax/test/stf/error_checks/data_interface_mismatch.cu +++ b/cudax/test/stf/error_checks/data_interface_mismatch.cu @@ -63,9 +63,9 @@ void run(double (&X)[n]) int main() { /* Setup an handler to catch the SIGABRT signal during the programming error */ -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -76,7 +76,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) const int n = 12; double X[n]; diff --git a/cudax/test/stf/error_checks/double_finalize.cu b/cudax/test/stf/error_checks/double_finalize.cu index 6de61c0c2b3..37913ca6e36 100644 --- a/cudax/test/stf/error_checks/double_finalize.cu +++ b/cudax/test/stf/error_checks/double_finalize.cu @@ -39,9 +39,9 @@ int main() // This test only works when assert() is enabled in #ifndef NDEBUG /* Setup an handler to catch the SIGABRT signal during the programming error */ -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -52,7 +52,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) context ctx; diff --git a/cudax/test/stf/error_checks/erase_frozen.cu b/cudax/test/stf/error_checks/erase_frozen.cu index 3e99c360aa2..624dfb062f8 100644 --- a/cudax/test/stf/error_checks/erase_frozen.cu +++ b/cudax/test/stf/error_checks/erase_frozen.cu @@ -40,9 +40,9 @@ void cleanupRoutine(int /*unused*/) int main() { /* Setup an handler to catch the SIGABRT signal during the programming error */ -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -53,7 +53,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) stream_ctx ctx; const int N = 16; diff --git a/cudax/test/stf/error_checks/misformed_tasks_dbl_end.cu b/cudax/test/stf/error_checks/misformed_tasks_dbl_end.cu index b91a8d0aabb..fa28e5467e0 100644 --- a/cudax/test/stf/error_checks/misformed_tasks_dbl_end.cu +++ b/cudax/test/stf/error_checks/misformed_tasks_dbl_end.cu @@ -39,9 +39,9 @@ int main() // This test only works when assert() is enabled in #ifndef NDEBUG /* Setup an handler to catch the SIGABRT signal during the programming error */ -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -52,7 +52,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) stream_ctx ctx; diff --git a/cudax/test/stf/error_checks/misformed_tasks_dbl_start.cu b/cudax/test/stf/error_checks/misformed_tasks_dbl_start.cu index 3f783773b0e..b35cb99457f 100644 --- a/cudax/test/stf/error_checks/misformed_tasks_dbl_start.cu +++ b/cudax/test/stf/error_checks/misformed_tasks_dbl_start.cu @@ -37,9 +37,9 @@ void cleanupRoutine(int /*unused*/) int main() { /* Setup an handler to catch the SIGABRT signal during the programming error */ -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -50,7 +50,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) stream_ctx ctx; diff --git a/cudax/test/stf/error_checks/non_managed_data.cu b/cudax/test/stf/error_checks/non_managed_data.cu index 387322a0912..a1188c7750f 100644 --- a/cudax/test/stf/error_checks/non_managed_data.cu +++ b/cudax/test/stf/error_checks/non_managed_data.cu @@ -41,9 +41,9 @@ int main() { /* Setup an handler to catch the SIGABRT signal during the programming error */ #ifndef NDEBUG -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -54,7 +54,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) stream_ctx ctx; diff --git a/cudax/test/stf/error_checks/slice_check_bounds.cu b/cudax/test/stf/error_checks/slice_check_bounds.cu index f27cebdd722..fecea9e7a55 100644 --- a/cudax/test/stf/error_checks/slice_check_bounds.cu +++ b/cudax/test/stf/error_checks/slice_check_bounds.cu @@ -48,9 +48,9 @@ int main() { /* Setup an handler to catch the SIGABRT signal during the programming error */ #ifndef NDEBUG -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -61,7 +61,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) context ctx; diff --git a/cudax/test/stf/error_checks/uninitialized_data.cu b/cudax/test/stf/error_checks/uninitialized_data.cu index efd45db4d1b..6af57556ad5 100644 --- a/cudax/test/stf/error_checks/uninitialized_data.cu +++ b/cudax/test/stf/error_checks/uninitialized_data.cu @@ -39,9 +39,9 @@ int main() { /* Setup an handler to catch the SIGABRT signal during the programming error */ #ifndef NDEBUG -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -52,7 +52,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) stream_ctx ctx; diff --git a/cudax/test/stf/error_checks/unsatisfiable_spec.cu b/cudax/test/stf/error_checks/unsatisfiable_spec.cu index ee3c10ad9cf..a0e4277979c 100644 --- a/cudax/test/stf/error_checks/unsatisfiable_spec.cu +++ b/cudax/test/stf/error_checks/unsatisfiable_spec.cu @@ -39,9 +39,9 @@ int main() { /* Setup an handler to catch the SIGABRT signal during the programming error */ #ifndef NDEBUG -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -52,7 +52,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) context ctx; diff --git a/cudax/test/stf/error_checks/write_frozen.cu b/cudax/test/stf/error_checks/write_frozen.cu index 1d46c702c0f..b4e08642a5e 100644 --- a/cudax/test/stf/error_checks/write_frozen.cu +++ b/cudax/test/stf/error_checks/write_frozen.cu @@ -40,9 +40,9 @@ void cleanupRoutine(int /*unused*/) int main() { /* Setup an handler to catch the SIGABRT signal during the programming error */ -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) signal(SIGABRT, &cleanupRoutine); -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) struct sigaction sigabrt_action {}; memset(&sigabrt_action, 0, sizeof(sigabrt_action)); @@ -53,7 +53,7 @@ int main() perror("sigaction SIGABRT"); exit(EXIT_FAILURE); } -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) stream_ctx ctx; const int N = 16; diff --git a/cudax/test/stf/parallel_for/fdtd.cu b/cudax/test/stf/parallel_for/fdtd.cu index 0e97d2e7afd..686d613d710 100644 --- a/cudax/test/stf/parallel_for/fdtd.cu +++ b/cudax/test/stf/parallel_for/fdtd.cu @@ -14,7 +14,7 @@ using namespace cuda::experimental::stf; // FIXME : MSVC has trouble with box constructors -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) void write_vtk_2D(const std::string& filename, slice Ez, double dx, double dy, double /*unused*/) { FILE* f = fopen(filename.c_str(), "w"); @@ -92,11 +92,11 @@ __device__ double Source(double t, double x, double y, double z) constexpr double k = 2 * pi / wavelength; return sin(k * x - omega * t); } -#endif // !defined(_CCCL_COMPILER_MSVC) +#endif // !_CCCL_COMPILER(MSVC) int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) { -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) stream_ctx ctx; // Domain dimensions @@ -250,5 +250,5 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) } ctx.finalize(); -#endif // !defined(_CCCL_COMPILER_MSVC) +#endif // !_CCCL_COMPILER(MSVC) } diff --git a/cudax/test/stf/reclaiming/graph.cu b/cudax/test/stf/reclaiming/graph.cu index 3c77cb15980..56e82254bff 100644 --- a/cudax/test/stf/reclaiming/graph.cu +++ b/cudax/test/stf/reclaiming/graph.cu @@ -10,19 +10,19 @@ #include -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) using namespace cuda::experimental::stf; __global__ void kernel() { // No-op } -#endif // !defined(_CCCL_COMPILER_MSVC) +#endif // !_CCCL_COMPILER(MSVC) int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) { // TODO fix setenv -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) int nblocks = 4; size_t block_size = 1024 * 1024; @@ -68,5 +68,5 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv) } ctx.finalize(); -#endif // !defined(_CCCL_COMPILER_MSVC) +#endif // !_CCCL_COMPILER(MSVC) } diff --git a/cudax/test/stf/stress/task_bench.cu b/cudax/test/stf/stress/task_bench.cu index 769b057075b..5d5d483c9ca 100644 --- a/cudax/test/stf/stress/task_bench.cu +++ b/cudax/test/stf/stress/task_bench.cu @@ -57,10 +57,10 @@ int log2Int(int n) return result; } -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) _CCCL_DIAG_PUSH _CCCL_DIAG_SUPPRESS_MSVC(4702) // unreachable code -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) bool skip_task(test_id id, int t, int i, int /*W*/) { switch (id) @@ -89,9 +89,9 @@ bool skip_task(test_id id, int t, int i, int /*W*/) abort(); return true; } -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) _CCCL_DIAG_POP -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) std::vector input_deps(test_id id, int t, int i, int W) { diff --git a/cudax/test/stf/tools/auto_dump/auto_dump.cu b/cudax/test/stf/tools/auto_dump/auto_dump.cu index 835016fcf2a..dd9b06981d4 100644 --- a/cudax/test/stf/tools/auto_dump/auto_dump.cu +++ b/cudax/test/stf/tools/auto_dump/auto_dump.cu @@ -21,7 +21,7 @@ using namespace cuda::experimental::stf; int main() { -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) // Generate a random dirname srand(static_cast(time(nullptr))); int r = rand(); @@ -60,5 +60,5 @@ int main() EXPECT(!std::filesystem::exists(dirname + "/" + std::to_string(2))); std::filesystem::remove_all(dirname); -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) } diff --git a/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h index d82ba355ff4..72e01a5521d 100644 --- a/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#if !defined(_CCCL_COMPILER_MSVC_2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) +#if !_CCCL_COMPILER(MSVC2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) # if defined(_CCCL_CUDA_COMPILER_CLANG) # include @@ -214,6 +214,6 @@ _LIBCUDACXX_END_NAMESPACE_CUDA_MR # endif // _CCCL_STD_VER >= 2014 -#endif // !_CCCL_COMPILER_MSVC_2017 && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE +#endif // !_CCCL_COMPILER(MSVC2017) && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE #endif // _CUDA__MEMORY_RESOURCE_CUDA_MEMORY_RESOURCE_H diff --git a/libcudacxx/include/cuda/__memory_resource/get_property.h b/libcudacxx/include/cuda/__memory_resource/get_property.h index fcfa023e6fa..d9b762225eb 100644 --- a/libcudacxx/include/cuda/__memory_resource/get_property.h +++ b/libcudacxx/include/cuda/__memory_resource/get_property.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#if !defined(_CCCL_COMPILER_MSVC_2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) +#if !_CCCL_COMPILER(MSVC2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) # include # include @@ -180,6 +180,6 @@ _LIBCUDACXX_END_NAMESPACE_CUDA # endif // _CCCL_STD_VER >= 2014 -#endif // !_CCCL_COMPILER_MSVC_2017 && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE +#endif // !_CCCL_COMPILER(MSVC2017) && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE #endif //_CUDA__MEMORY_RESOURCE_GET_PROPERTY_H diff --git a/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h index c1af2074beb..86835aede18 100644 --- a/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#if !defined(_CCCL_COMPILER_MSVC_2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) +#if !_CCCL_COMPILER(MSVC2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) # if defined(_CCCL_CUDA_COMPILER_CLANG) # include @@ -196,6 +196,6 @@ _LIBCUDACXX_END_NAMESPACE_CUDA_MR # endif // _CCCL_STD_VER >= 2014 -#endif // !_CCCL_COMPILER_MSVC_2017 && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE +#endif // !_CCCL_COMPILER(MSVC2017) && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE #endif //_CUDA__MEMORY_RESOURCE_CUDA_MANAGED_MEMORY_RESOURCE_H diff --git a/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h index 2fe29653d75..819d485a104 100644 --- a/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#if !defined(_CCCL_COMPILER_MSVC_2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) +#if !_CCCL_COMPILER(MSVC2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) # if defined(_CCCL_CUDA_COMPILER_CLANG) # include @@ -199,6 +199,6 @@ _LIBCUDACXX_END_NAMESPACE_CUDA_MR # endif // _CCCL_STD_VER >= 2014 -#endif // !_CCCL_COMPILER_MSVC_2017 && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE +#endif // !_CCCL_COMPILER(MSVC2017) && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE #endif //_CUDA__MEMORY_RESOURCE_CUDA_PINNED_MEMORY_RESOURCE_H diff --git a/libcudacxx/include/cuda/__memory_resource/properties.h b/libcudacxx/include/cuda/__memory_resource/properties.h index 42fbbda5f7b..6b0279eb06f 100644 --- a/libcudacxx/include/cuda/__memory_resource/properties.h +++ b/libcudacxx/include/cuda/__memory_resource/properties.h @@ -24,7 +24,7 @@ #include #include -#if !defined(_CCCL_COMPILER_MSVC_2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) +#if !_CCCL_COMPILER(MSVC2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) # if _CCCL_STD_VER >= 2014 @@ -68,6 +68,6 @@ _LIBCUDACXX_END_NAMESPACE_CUDA_MR # endif // _CCCL_STD_VER >= 2014 -#endif // !_CCCL_COMPILER_MSVC_2017 && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE +#endif // !_CCCL_COMPILER(MSVC2017) && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE #endif //_CUDA__MEMORY_RESOURCE_PROPERTIES_H diff --git a/libcudacxx/include/cuda/__memory_resource/resource.h b/libcudacxx/include/cuda/__memory_resource/resource.h index bfcf6d73174..0b864e649d6 100644 --- a/libcudacxx/include/cuda/__memory_resource/resource.h +++ b/libcudacxx/include/cuda/__memory_resource/resource.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#if !defined(_CCCL_COMPILER_MSVC_2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) +#if !_CCCL_COMPILER(MSVC2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) # include # include @@ -129,6 +129,6 @@ _LIBCUDACXX_END_NAMESPACE_CUDA_MR # endif // _CCCL_STD_VER >= 2014 -#endif // !_CCCL_COMPILER_MSVC_2017 && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE +#endif // !_CCCL_COMPILER(MSVC2017) && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE #endif //_CUDA__MEMORY_RESOURCE_RESOURCE_H diff --git a/libcudacxx/include/cuda/__memory_resource/resource_ref.h b/libcudacxx/include/cuda/__memory_resource/resource_ref.h index 164625c6493..81831720349 100644 --- a/libcudacxx/include/cuda/__memory_resource/resource_ref.h +++ b/libcudacxx/include/cuda/__memory_resource/resource_ref.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#if !defined(_CCCL_COMPILER_MSVC_2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) +#if !_CCCL_COMPILER(MSVC2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) # include # include @@ -640,6 +640,6 @@ _LIBCUDACXX_END_NAMESPACE_CUDA_MR # endif // _CCCL_STD_VER >= 2014 -#endif // !_CCCL_COMPILER_MSVC_2017 && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE +#endif // !_CCCL_COMPILER(MSVC2017) && LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE #endif //_CUDA__MEMORY_RESOURCE_RESOURCE_REF_H diff --git a/libcudacxx/include/cuda/std/__algorithm/iterator_operations.h b/libcudacxx/include/cuda/std/__algorithm/iterator_operations.h index 7eb7a715962..be02de72b97 100644 --- a/libcudacxx/include/cuda/std/__algorithm/iterator_operations.h +++ b/libcudacxx/include/cuda/std/__algorithm/iterator_operations.h @@ -44,7 +44,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD template struct _IterOps; -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) struct _RangeAlgPolicy {}; @@ -69,7 +69,7 @@ struct _IterOps<_RangeAlgPolicy> static constexpr auto __advance_to = _CUDA_VRANGES::advance; }; -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) struct _ClassicAlgPolicy {}; diff --git a/libcudacxx/include/cuda/std/__algorithm/ranges_iterator_concept.h b/libcudacxx/include/cuda/std/__algorithm/ranges_iterator_concept.h index 7562eedbf95..43e674b976f 100644 --- a/libcudacxx/include/cuda/std/__algorithm/ranges_iterator_concept.h +++ b/libcudacxx/include/cuda/std/__algorithm/ranges_iterator_concept.h @@ -24,7 +24,7 @@ #include #include -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_BEGIN_NAMESPACE_RANGES @@ -60,6 +60,6 @@ using __iterator_concept = decltype(__get_iterator_concept<_Iter>()); _LIBCUDACXX_END_NAMESPACE_RANGES -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX___ALGORITHM_RANGES_ITERATOR_CONCEPT_H diff --git a/libcudacxx/include/cuda/std/__atomic/platform.h b/libcudacxx/include/cuda/std/__atomic/platform.h index 6367e20234e..66eae16ffaa 100644 --- a/libcudacxx/include/cuda/std/__atomic/platform.h +++ b/libcudacxx/include/cuda/std/__atomic/platform.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # include #endif diff --git a/libcudacxx/include/cuda/std/__atomic/platform/msvc_to_builtins.h b/libcudacxx/include/cuda/std/__atomic/platform/msvc_to_builtins.h index eb5721c8022..8c532260284 100644 --- a/libcudacxx/include/cuda/std/__atomic/platform/msvc_to_builtins.h +++ b/libcudacxx/include/cuda/std/__atomic/platform/msvc_to_builtins.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # include # include @@ -637,6 +637,6 @@ _Type __atomic_fetch_min(_Type volatile* __ptr, _Delta __val, int __memorder) _LIBCUDACXX_END_NAMESPACE_STD -#endif // defined(_CCCL_COMPILER_MSVC) +#endif // _CCCL_COMPILER(MSVC) #endif // __LIBCUDACXX___ATOMIC_PLATFORM_MSVC_H diff --git a/libcudacxx/include/cuda/std/__bit/clz.h b/libcudacxx/include/cuda/std/__bit/clz.h index c61508f8287..267f022737a 100644 --- a/libcudacxx/include/cuda/std/__bit/clz.h +++ b/libcudacxx/include/cuda/std/__bit/clz.h @@ -24,9 +24,9 @@ #include #include -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # include -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -55,7 +55,7 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr int __binary_clz64(uint64_t __x) return __binary_clz32(__x >> 32 * !!(__x & 0xFFFFFFFF00000000), 32 * !(__x & 0xFFFFFFFF00000000)); } -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) _LIBCUDACXX_HIDE_FROM_ABI constexpr int __constexpr_clz(uint32_t __x) noexcept { @@ -97,7 +97,7 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr int __libcpp_clz(uint64_t __x) noexcept return __constexpr_clz(__x); } -#else // defined(_CCCL_COMPILER_MSVC) +#else // _CCCL_COMPILER(MSVC) // Precondition: __x != 0 _LIBCUDACXX_HIDE_FROM_ABI constexpr int __libcpp_clz(uint32_t __x) diff --git a/libcudacxx/include/cuda/std/__bit/ctz.h b/libcudacxx/include/cuda/std/__bit/ctz.h index 0f08f67d38b..9d2e771bd61 100644 --- a/libcudacxx/include/cuda/std/__bit/ctz.h +++ b/libcudacxx/include/cuda/std/__bit/ctz.h @@ -24,9 +24,9 @@ #include #include -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # include -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -55,7 +55,7 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr int __binary_ctz64(uint64_t __x) noexcept return __binary_ctz32(__x >> 32 * !(__x & 0x00000000FFFFFFFF), 32 * !(__x & 0x00000000FFFFFFFF)); } -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) _LIBCUDACXX_HIDE_FROM_ABI constexpr int __constexpr_ctz(uint32_t __x) noexcept { @@ -99,7 +99,7 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr int __libcpp_ctz(uint64_t __x) noexcept return __constexpr_ctz(__x); } -#else // defined(_CCCL_COMPILER_MSVC) +#else // _CCCL_COMPILER(MSVC) // Precondition: __x != 0 _LIBCUDACXX_HIDE_FROM_ABI constexpr int __libcpp_ctz(uint32_t __x) diff --git a/libcudacxx/include/cuda/std/__bit/popc.h b/libcudacxx/include/cuda/std/__bit/popc.h index d3ec52342ad..dc22999b985 100644 --- a/libcudacxx/include/cuda/std/__bit/popc.h +++ b/libcudacxx/include/cuda/std/__bit/popc.h @@ -24,7 +24,7 @@ #include #include -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # include # if defined(_M_ARM64) @@ -35,7 +35,7 @@ # define _LIBCUDACXX_MSVC_POPC64(x) __popcnt64(x) # endif // !_M_ARM64 -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -56,7 +56,7 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr int __fallback_popc64(uint64_t __x) return __fallback_popc32(__x - ((__x >> 1) & 0x5555555555555555)); } -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) _LIBCUDACXX_HIDE_FROM_ABI constexpr int __constexpr_popcount(uint32_t __x) noexcept { @@ -98,7 +98,7 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr int __libcpp_popc(uint64_t __x) noexcept return __constexpr_popcount(static_cast(__x)); } -#else // defined(_CCCL_COMPILER_MSVC) +#else // _CCCL_COMPILER(MSVC) _LIBCUDACXX_HIDE_FROM_ABI constexpr int __libcpp_popc(uint32_t __x) { diff --git a/libcudacxx/include/cuda/std/__cccl/assert.h b/libcudacxx/include/cuda/std/__cccl/assert.h index 70b2398cccf..8c48296619c 100644 --- a/libcudacxx/include/cuda/std/__cccl/assert.h +++ b/libcudacxx/include/cuda/std/__cccl/assert.h @@ -64,7 +64,7 @@ //! _CCCL_ASSERT_IMPL_HOST should never be used directly #if _CCCL_COMPILER(NVRTC) // There is no host standard library in nvrtc # define _CCCL_ASSERT_IMPL_HOST(expression, message) ((void) 0) -#elif _CCCL_HAS_INCLUDE() && defined(_CCCL_COMPILER_MSVC) // MSVC uses _STL_VERIFY from +#elif _CCCL_HAS_INCLUDE() && _CCCL_COMPILER(MSVC) // MSVC uses _STL_VERIFY from # include # define _CCCL_ASSERT_IMPL_HOST(expression, message) _STL_VERIFY(expression, message) #else // ^^^ MSVC STL ^^^ / vvv !MSVC STL vvv @@ -97,15 +97,15 @@ _CCCL_HOST_DEVICE _CCCL_BUILTIN_EXPECT(static_cast(expression), 1) \ ? (void) 0 : __assertfail(message, __FILE__, __LINE__, __func__, sizeof(char)) #elif defined(_CCCL_CUDA_COMPILER_NVCC) //! Use __assert_fail to implement device side asserts -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) # define _CCCL_ASSERT_IMPL_DEVICE(expression, message) \ _CCCL_BUILTIN_EXPECT(static_cast(expression), 1) \ ? (void) 0 : _wassert(_CRT_WIDE(#message), __FILEW__, __LINE__) -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv # define _CCCL_ASSERT_IMPL_DEVICE(expression, message) \ _CCCL_BUILTIN_EXPECT(static_cast(expression), 1) \ ? (void) 0 : __assert_fail(message, __FILE__, __LINE__, __func__) -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) #elif defined(_CCCL_CUDA_COMPILER) # define _CCCL_ASSERT_IMPL_DEVICE(expression, message) _CCCL_ASSERT_IMPL_HOST(expression, message) #else // ^^^ _CCCL_CUDA_COMPILER ^^^ / vvv !_CCCL_CUDA_COMPILER vvv diff --git a/libcudacxx/include/cuda/std/__cccl/attributes.h b/libcudacxx/include/cuda/std/__cccl/attributes.h index 7a8bcb49f0b..0ed5fdd2b7f 100644 --- a/libcudacxx/include/cuda/std/__cccl/attributes.h +++ b/libcudacxx/include/cuda/std/__cccl/attributes.h @@ -80,7 +80,7 @@ # define _CCCL_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS #endif // !_CCCL_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS && _CCCL_COMPILER(CLANG) -#if _CCCL_HAS_CPP_ATTRIBUTE(nodiscard) || (defined(_CCCL_COMPILER_MSVC) && _CCCL_STD_VER >= 2017) +#if _CCCL_HAS_CPP_ATTRIBUTE(nodiscard) || (_CCCL_COMPILER(MSVC) && _CCCL_STD_VER >= 2017) # define _CCCL_NODISCARD [[nodiscard]] #else // ^^^ has nodiscard ^^^ / vvv no nodiscard vvv # define _CCCL_NODISCARD @@ -101,7 +101,7 @@ # define _CCCL_ALIAS_ATTRIBUTE(...) __VA_ARGS__ #endif // _CCCL_CUDACC_AT_LEAST(11, 3) -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # define _CCCL_NORETURN __declspec(noreturn) #elif _CCCL_HAS_CPP_ATTRIBUTE(noreturn) # define _CCCL_NORETURN [[noreturn]] @@ -109,10 +109,10 @@ # define _CCCL_NORETURN __attribute__((noreturn)) #endif -#if defined(_CCCL_COMPILER_MSVC) // vvv _CCCL_COMPILER_MSVC vvv +#if _CCCL_COMPILER(MSVC) // vvv _CCCL_COMPILER(MSVC) vvv # define _CCCL_RESTRICT __restrict -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv # define _CCCL_RESTRICT __restrict__ -#endif // ^^^ !_CCCL_COMPILER_MSVC ^^^ +#endif // ^^^ !_CCCL_COMPILER(MSVC) ^^^ #endif // __CCCL_ATTRIBUTES_H diff --git a/libcudacxx/include/cuda/std/__cccl/builtin.h b/libcudacxx/include/cuda/std/__cccl/builtin.h index ac93b0f8caf..b3a53918054 100644 --- a/libcudacxx/include/cuda/std/__cccl/builtin.h +++ b/libcudacxx/include/cuda/std/__cccl/builtin.h @@ -86,8 +86,7 @@ # define _CCCL_BUILTIN_ARRAY_EXTENT(...) __array_extent(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__array_extent) -#if _CCCL_HAS_BUILTIN(__builtin_assume_aligned) || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1923) \ - || _CCCL_COMPILER(GCC) +#if _CCCL_HAS_BUILTIN(__builtin_assume_aligned) || _CCCL_COMPILER(MSVC, >=, 19, 23) || _CCCL_COMPILER(GCC) # define _CCCL_BUILTIN_ASSUME_ALIGNED(...) __builtin_assume_aligned(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__builtin_assume_aligned) @@ -97,7 +96,7 @@ #endif // _CCCL_CUDACC_BELOW(11, 2) // nvhpc has a bug where it supports __builtin_addressof but does not mark it via _CCCL_CHECK_BUILTIN -#if _CCCL_CHECK_BUILTIN(builtin_addressof) || _CCCL_COMPILER(GCC, >=, 7) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(builtin_addressof) || _CCCL_COMPILER(GCC, >=, 7) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVHPC) # define _CCCL_BUILTIN_ADDRESSOF(...) __builtin_addressof(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(builtin_addressof) @@ -117,7 +116,7 @@ #endif // _CCCL_CUDACC_BELOW(11, 2) // MSVC supports __builtin_bit_cast from 19.25 on -#if _CCCL_CHECK_BUILTIN(builtin_bit_cast) || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION > 1925) +#if _CCCL_CHECK_BUILTIN(builtin_bit_cast) || _CCCL_COMPILER(MSVC, >, 19, 25) # define _CCCL_BUILTIN_BIT_CAST(...) __builtin_bit_cast(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(builtin_bit_cast) @@ -127,7 +126,7 @@ # undef _CCCL_BUILTIN_BIT_CAST #endif // clang < 10 || nvcc < 11.7 -#if _CCCL_HAS_BUILTIN(__builtin_COLUMN) || defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1927 +#if _CCCL_HAS_BUILTIN(__builtin_COLUMN) || _CCCL_COMPILER(MSVC, >=, 19, 27) # define _CCCL_BUILTIN_COLUMN() __builtin_COLUMN() #else // ^^^ _CCCL_HAS_BUILTIN(__builtin_COLUMN) ^^^ / vvv !_CCCL_HAS_BUILTIN(__builtin_COLUMN) vvv # define _CCCL_BUILTIN_COLUMN() 0 @@ -143,12 +142,11 @@ # define _CCCL_BUILTIN_CONSTANT_P(...) __builtin_constant_p(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(builtin_contant_p) -#if _CCCL_CHECK_BUILTIN(builtin_expect) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(GCC) +#if _CCCL_CHECK_BUILTIN(builtin_expect) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(GCC) # define _CCCL_BUILTIN_EXPECT(...) __builtin_expect(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(builtin_expect) -#if _CCCL_HAS_BUILTIN(__builtin_FILE) || _CCCL_COMPILER(GCC) \ - || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1927) +#if _CCCL_HAS_BUILTIN(__builtin_FILE) || _CCCL_COMPILER(GCC) || _CCCL_COMPILER(MSVC, >=, 19, 27) # define _CCCL_BUILTIN_FILE() __builtin_FILE() #else // ^^^ _CCCL_HAS_BUILTIN(__builtin_FILE) ^^^ / vvv !_CCCL_HAS_BUILTIN(__builtin_FILE) vvv # define _CCCL_BUILTIN_FILE() __FILE__ @@ -160,8 +158,7 @@ # define _CCCL_BUILTIN_FILE() __FILE__ #endif // _CCCL_CUDACC_BELOW(11, 3) -#if _CCCL_HAS_BUILTIN(__builtin_FUNCTION) || _CCCL_COMPILER(GCC) \ - || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1927) +#if _CCCL_HAS_BUILTIN(__builtin_FUNCTION) || _CCCL_COMPILER(GCC) || _CCCL_COMPILER(MSVC, >=, 19, 27) # define _CCCL_BUILTIN_FUNCTION() __builtin_FUNCTION() #else // ^^^ _CCCL_HAS_BUILTIN(__builtin_FUNCTION) ^^^ / vvv !_CCCL_HAS_BUILTIN(__builtin_FUNCTION) vvv # define _CCCL_BUILTIN_FUNCTION() "__builtin_FUNCTION is unsupported" @@ -174,7 +171,7 @@ #endif // _CCCL_CUDACC_BELOW(11, 3) #if _CCCL_CHECK_BUILTIN(builtin_is_constant_evaluated) || _CCCL_COMPILER(GCC, >=, 9) \ - || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION > 1924 && _CCCL_CUDACC_AT_LEAST(11, 3)) + || (_CCCL_COMPILER(MSVC, >, 19, 24) && _CCCL_CUDACC_AT_LEAST(11, 3)) # define _CCCL_BUILTIN_IS_CONSTANT_EVALUATED(...) __builtin_is_constant_evaluated(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(builtin_is_constant_evaluated) @@ -193,8 +190,7 @@ # undef _CCCL_BUILTIN_LAUNDER #endif // clang < 10 || nvcc < 11.3 -#if _CCCL_HAS_BUILTIN(__builtin_LINE) || _CCCL_COMPILER(GCC) \ - || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1927) +#if _CCCL_HAS_BUILTIN(__builtin_LINE) || _CCCL_COMPILER(GCC) || _CCCL_COMPILER(MSVC, >=, 19, 27) # define _CCCL_BUILTIN_LINE() __builtin_LINE() #else // ^^^ _CCCL_HAS_BUILTIN(__builtin_LINE) ^^^ / vvv !_CCCL_HAS_BUILTIN(__builtin_LINE) vvv # define _CCCL_BUILTIN_LINE() __LINE__ @@ -216,27 +212,27 @@ # define _CCCL_BUILTIN_DECAY(...) __decay(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__decay) && clang-cuda -#if _CCCL_CHECK_BUILTIN(has_nothrow_assign) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(has_nothrow_assign) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_NOTHROW_ASSIGN(...) __has_nothrow_assign(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_nothrow_assign) && gcc >= 4.3 -#if _CCCL_CHECK_BUILTIN(has_nothrow_constructor) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(has_nothrow_constructor) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_NOTHROW_CONSTRUCTOR(...) __has_nothrow_constructor(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_nothrow_constructor) && gcc >= 4.3 -#if _CCCL_CHECK_BUILTIN(has_nothrow_copy) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(has_nothrow_copy) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_NOTHROW_COPY(...) __has_nothrow_copy(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_nothrow_copy) && gcc >= 4.3 -#if _CCCL_CHECK_BUILTIN(has_trivial_constructor) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(has_trivial_constructor) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_TRIVIAL_CONSTRUCTOR(...) __has_trivial_constructor(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_trivial_constructor) && gcc >= 4.3 -#if _CCCL_CHECK_BUILTIN(has_trivial_destructor) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(has_trivial_destructor) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_TRIVIAL_DESTRUCTOR(...) __has_trivial_destructor(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_trivial_destructor) && gcc >= 4.3 @@ -245,7 +241,7 @@ # define _CCCL_BUILTIN_HAS_UNIQUE_OBJECT_REPRESENTATIONS(...) __has_unique_object_representations(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_unique_object_representations) && gcc >= 7.0 -#if _CCCL_CHECK_BUILTIN(has_virtual_destructor) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(has_virtual_destructor) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_HAS_VIRTUAL_DESTRUCTOR(...) __has_virtual_destructor(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(has_virtual_destructor) && gcc >= 4.3 @@ -254,8 +250,8 @@ # define _CCCL_BUILTIN_INTEGER_PACK(...) __integer_pack(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__integer_pack) -#if _CCCL_CHECK_BUILTIN(is_aggregate) || _CCCL_COMPILER(GCC, >=, 7) \ - || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION > 1914) || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_aggregate) || _CCCL_COMPILER(GCC, >=, 7) || _CCCL_COMPILER(MSVC, >, 19, 14) \ + || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_AGGREGATE(...) __is_aggregate(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_aggregate) && gcc >= 7.0 @@ -268,17 +264,15 @@ # undef _CCCL_BUILTIN_IS_ARRAY #endif // clang < 19 -#if _CCCL_CHECK_BUILTIN(is_assignable) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(GCC, >=, 9) +#if _CCCL_CHECK_BUILTIN(is_assignable) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(GCC, >=, 9) # define _CCCL_BUILTIN_IS_ASSIGNABLE(...) __is_assignable(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_assignable) && gcc >= 9.0 -#if _CCCL_CHECK_BUILTIN(is_base_of) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ - || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_base_of) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_BASE_OF(...) __is_base_of(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_base_of) && gcc >= 4.3 -#if _CCCL_CHECK_BUILTIN(is_class) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ - || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_class) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_CLASS(...) __is_class(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_class) && gcc >= 4.3 @@ -290,31 +284,27 @@ # define _CCCL_BUILTIN_IS_CONST(...) __is_const(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__is_const) -#if _CCCL_CHECK_BUILTIN(is_constructible) || _CCCL_COMPILER(GCC, >=, 8) || defined(_CCCL_COMPILER_MSVC) \ - || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_constructible) || _CCCL_COMPILER(GCC, >=, 8) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_CONSTRUCTIBLE(...) __is_constructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_constructible) && gcc >= 8.0 -#if _CCCL_CHECK_BUILTIN(is_convertible_to) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_convertible_to) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_CONVERTIBLE_TO(...) __is_convertible_to(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_convertible_to) -#if _CCCL_CHECK_BUILTIN(is_destructible) || defined(_CCCL_COMPILER_MSVC) +#if _CCCL_CHECK_BUILTIN(is_destructible) || _CCCL_COMPILER(MSVC) # define _CCCL_BUILTIN_IS_DESTRUCTIBLE(...) __is_destructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_destructible) -#if _CCCL_CHECK_BUILTIN(is_empty) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ - || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_empty) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_EMPTY(...) __is_empty(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_empty) && gcc >= 4.3 -#if _CCCL_CHECK_BUILTIN(is_enum) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ - || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_enum) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_ENUM(...) __is_enum(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_enum) && gcc >= 4.3 -#if _CCCL_CHECK_BUILTIN(is_final) || _CCCL_COMPILER(GCC, >=, 4, 7) || defined(_CCCL_COMPILER_MSVC) \ - || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_final) || _CCCL_COMPILER(GCC, >=, 4, 7) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_FINAL(...) __is_final(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_final) && gcc >= 4.7 @@ -341,7 +331,7 @@ # define _CCCL_BUILTIN_IS_INTEGRAL(...) __is_integral(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__is_integral) -#if _CCCL_CHECK_BUILTIN(is_literal_type) || _CCCL_COMPILER(GCC, >=, 4, 6) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(is_literal_type) || _CCCL_COMPILER(GCC, >=, 4, 6) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_LITERAL(...) __is_literal_type(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_literal_type) && gcc >= 4.6 @@ -367,15 +357,15 @@ # define _CCCL_BUILTIN_IS_MEMBER_POINTER(...) __is_member_pointer(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__is_member_pointer) -#if _CCCL_CHECK_BUILTIN(is_nothrow_assignable) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_nothrow_assignable) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_NOTHROW_ASSIGNABLE(...) __is_nothrow_assignable(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_nothrow_assignable) -#if _CCCL_CHECK_BUILTIN(is_nothrow_constructible) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_nothrow_constructible) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_NOTHROW_CONSTRUCTIBLE(...) __is_nothrow_constructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_nothrow_constructible) -#if _CCCL_CHECK_BUILTIN(is_nothrow_destructible) || defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_nothrow_destructible) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_NOTHROW_DESTRUCTIBLE(...) __is_nothrow_destructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_nothrow_destructible) @@ -388,8 +378,7 @@ # undef _CCCL_BUILTIN_IS_OBJECT #endif // _CCCL_CUDACC_BELOW(11, 3) -#if _CCCL_CHECK_BUILTIN(is_pod) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ - || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_pod) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_POD(...) __is_pod(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_pod) && gcc >= 4.3 @@ -398,7 +387,7 @@ # define _CCCL_BUILTIN_IS_POINTER(...) __is_pointer(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__is_pointer) -#if _CCCL_CHECK_BUILTIN(is_polymorphic) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(is_polymorphic) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_POLYMORPHIC(...) __is_polymorphic(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_polymorphic) && gcc >= 4.3 @@ -430,38 +419,36 @@ # define _CCCL_BUILTIN_IS_SIGNED(...) __is_signed(__VA_ARGS__) #endif // _CCCL_HAS_BUILTIN(__is_signed) -#if _CCCL_CHECK_BUILTIN(is_standard_layout) || _CCCL_COMPILER(GCC, >=, 4, 7) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(is_standard_layout) || _CCCL_COMPILER(GCC, >=, 4, 7) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_STANDARD_LAYOUT(...) __is_standard_layout(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_standard_layout) && gcc >= 4.7 -#if _CCCL_CHECK_BUILTIN(is_trivial) || _CCCL_COMPILER(GCC, >=, 4, 5) || defined(_CCCL_COMPILER_MSVC) \ - || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_trivial) || _CCCL_COMPILER(GCC, >=, 4, 5) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_TRIVIAL(...) __is_trivial(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_trivial) && gcc >= 4.5 -#if _CCCL_CHECK_BUILTIN(is_trivially_assignable) || _CCCL_COMPILER(GCC, >=, 5, 1) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(is_trivially_assignable) || _CCCL_COMPILER(GCC, >=, 5, 1) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_TRIVIALLY_ASSIGNABLE(...) __is_trivially_assignable(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_trivially_assignable) && gcc >= 5.1 -#if _CCCL_CHECK_BUILTIN(is_trivially_constructible) || _CCCL_COMPILER(GCC, >=, 5, 1) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(is_trivially_constructible) || _CCCL_COMPILER(GCC, >=, 5, 1) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_TRIVIALLY_CONSTRUCTIBLE(...) __is_trivially_constructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_trivially_constructible) && gcc >= 5.1 -#if _CCCL_CHECK_BUILTIN(is_trivially_copyable) || _CCCL_COMPILER(GCC, >=, 5, 1) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(is_trivially_copyable) || _CCCL_COMPILER(GCC, >=, 5, 1) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_TRIVIALLY_COPYABLE(...) __is_trivially_copyable(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_trivially_copyable) && gcc >= 5.1 -#if _CCCL_CHECK_BUILTIN(is_trivially_destructible) || defined(_CCCL_COMPILER_MSVC) +#if _CCCL_CHECK_BUILTIN(is_trivially_destructible) || _CCCL_COMPILER(MSVC) # define _CCCL_BUILTIN_IS_TRIVIALLY_DESTRUCTIBLE(...) __is_trivially_destructible(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_trivially_destructible) -#if _CCCL_CHECK_BUILTIN(is_union) || _CCCL_COMPILER(GCC, >=, 4, 3) || defined(_CCCL_COMPILER_MSVC) \ - || _CCCL_COMPILER(NVRTC) +#if _CCCL_CHECK_BUILTIN(is_union) || _CCCL_COMPILER(GCC, >=, 4, 3) || _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_IS_UNION(...) __is_union(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(is_union) && gcc >= 4.3 @@ -496,7 +483,7 @@ # define _CCCL_BUILTIN_ISNAN(...) __builtin_isnan(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(isnan) -#if _CCCL_CHECK_BUILTIN(make_integer_seq) || (defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1923) +#if _CCCL_CHECK_BUILTIN(make_integer_seq) || _CCCL_COMPILER(MSVC, >=, 19, 23) # define _CCCL_BUILTIN_MAKE_INTEGER_SEQ(...) __make_integer_seq<__VA_ARGS__> #endif // _CCCL_CHECK_BUILTIN(make_integer_seq) @@ -553,27 +540,27 @@ # undef _CCCL_BUILTIN_TYPE_PACK_ELEMENT #endif // _CCCL_CUDACC_BELOW(12, 2) -#if _CCCL_CHECK_BUILTIN(underlying_type) || _CCCL_COMPILER(GCC, >=, 4, 7) || defined(_CCCL_COMPILER_MSVC) \ +#if _CCCL_CHECK_BUILTIN(underlying_type) || _CCCL_COMPILER(GCC, >=, 4, 7) || _CCCL_COMPILER(MSVC) \ || _CCCL_COMPILER(NVRTC) # define _CCCL_BUILTIN_UNDERLYING_TYPE(...) __underlying_type(__VA_ARGS__) #endif // _CCCL_CHECK_BUILTIN(underlying_type) && gcc >= 4.7 -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # // To use __builtin_FUNCSIG(), both MSVC and nvcc need to support it -# if _CCCL_MSVC_VERSION >= 1935 && _CCCL_CUDACC_AT_LEAST(12, 3) +# if _CCCL_COMPILER(MSVC, >=, 19, 35) && _CCCL_CUDACC_AT_LEAST(12, 3) # define _CCCL_BUILTIN_PRETTY_FUNCTION() __builtin_FUNCSIG() -# else // ^^^ _CCCL_MSVC_VERSION >= 1935 ^^^ / vvv _CCCL_MSVC_VERSION < 1935 vvv +# else // ^^^ _CCCL_COMPILER(MSVC, >=, 19, 35) ^^^ / vvv _CCCL_COMPILER(MSVC, <, 19, 35) vvv # define _CCCL_BUILTIN_PRETTY_FUNCTION() __FUNCSIG__ # define _CCCL_BROKEN_MSVC_FUNCSIG -# endif // _CCCL_MSVC_VERSION < 1935 -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +# endif // _CCCL_COMPILER(MSVC, <, 19, 35) +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv # define _CCCL_BUILTIN_PRETTY_FUNCTION() __PRETTY_FUNCTION__ -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) // GCC's builtin_strlen isn't reliable at constexpr time // MSVC does not expose builtin_strlen before C++17 // NVRTC does not expose builtin_strlen -#if !_CCCL_COMPILER(GCC) && !_CCCL_COMPILER(NVRTC) && !(defined(_CCCL_COMPILER_MSVC) && _CCCL_STD_VER < 2017) +#if !_CCCL_COMPILER(GCC) && !_CCCL_COMPILER(NVRTC) && !(_CCCL_COMPILER(MSVC) && _CCCL_STD_VER < 2017) # define _CCCL_BUILTIN_STRLEN(...) __builtin_strlen(__VA_ARGS__) #endif diff --git a/libcudacxx/include/cuda/std/__cccl/compiler.h b/libcudacxx/include/cuda/std/__cccl/compiler.h index 89c054a12a1..fd7e93d22cb 100644 --- a/libcudacxx/include/cuda/std/__cccl/compiler.h +++ b/libcudacxx/include/cuda/std/__cccl/compiler.h @@ -27,9 +27,14 @@ #elif defined(__GNUC__) # define _CCCL_COMPILER_GCC _CCCL_COMPILER_MAKE_VERSION(__GNUC__, __GNUC_MINOR__) #elif defined(_MSC_VER) -# define _CCCL_COMPILER_MSVC -# define _CCCL_MSVC_VERSION _MSC_VER -# define _CCCL_MSVC_VERSION_FULL _MSC_FULL_VER +# define _CCCL_COMPILER_MSVC _CCCL_COMPILER_MAKE_VERSION(_MSC_VER / 100, _MSC_VER % 100) +# define _CCCL_COMPILER_MSVC2017 (_CCCL_COMPILER_MSVC < _CCCL_COMPILER_MAKE_VERSION(19, 20)) +# define _CCCL_COMPILER_MSVC2019 \ + (_CCCL_COMPILER_MSVC >= _CCCL_COMPILER_MAKE_VERSION(19, 20) \ + && _CCCL_COMPILER_MSVC < _CCCL_COMPILER_MAKE_VERSION(19, 30)) +# define _CCCL_COMPILER_MSVC2022 \ + (_CCCL_COMPILER_MSVC >= _CCCL_COMPILER_MAKE_VERSION(19, 30) \ + && _CCCL_COMPILER_MSVC < _CCCL_COMPILER_MAKE_VERSION(19, 40)) #elif defined(__CUDACC_RTC__) # define _CCCL_COMPILER_NVRTC _CCCL_COMPILER_MAKE_VERSION(__CUDACC_VER_MAJOR__, __CUDACC_VER_MINOR__) #endif @@ -52,17 +57,6 @@ _CCCL_COMPILER_COMPARE_BAD_ARG_COUNT)) #define _CCCL_COMPILER(...) _CCCL_COMPILER_SELECT(_CCCL_COMPILER_##__VA_ARGS__)(_CCCL_COMPILER_##__VA_ARGS__) -// Convenient shortcut to determine which version of MSVC we are dealing with -#if defined(_CCCL_COMPILER_MSVC) -# if _MSC_VER < 1920 -# define _CCCL_COMPILER_MSVC_2017 -# elif _MSC_VER < 1930 -# define _CCCL_COMPILER_MSVC_2019 -# else // _MSC_VER < 1940 -# define _CCCL_COMPILER_MSVC_2022 -# endif // _MSC_VER < 1940 -#endif // _CCCL_COMPILER_MSVC - // Determine the cuda compiler #if defined(__NVCC__) # define _CCCL_CUDA_COMPILER_NVCC @@ -100,10 +94,10 @@ #define _CCCL_TO_STRING(_STR) _CCCL_TO_STRING2(_STR) // Define the pragma for the host compiler -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # define _CCCL_PRAGMA(_ARG) __pragma(_ARG) #else # define _CCCL_PRAGMA(_ARG) _Pragma(_CCCL_TO_STRING(_ARG)) -#endif // defined(_CCCL_COMPILER_MSVC) +#endif // _CCCL_COMPILER(MSVC) #endif // __CCCL_COMPILER_H diff --git a/libcudacxx/include/cuda/std/__cccl/diagnostic.h b/libcudacxx/include/cuda/std/__cccl/diagnostic.h index fdedae215f3..5824c65b8eb 100644 --- a/libcudacxx/include/cuda/std/__cccl/diagnostic.h +++ b/libcudacxx/include/cuda/std/__cccl/diagnostic.h @@ -55,7 +55,7 @@ # define _CCCL_DIAG_SUPPRESS_NVHPC(str) _CCCL_PRAGMA(diag_suppress str) # define _CCCL_DIAG_SUPPRESS_MSVC(str) # define _CCCL_DIAG_SUPPRESS_ICC(str) -#elif defined(_CCCL_COMPILER_MSVC) +#elif _CCCL_COMPILER(MSVC) # define _CCCL_DIAG_PUSH _CCCL_PRAGMA(warning(push)) # define _CCCL_DIAG_POP _CCCL_PRAGMA(warning(pop)) # define _CCCL_DIAG_SUPPRESS_CLANG(str) @@ -96,17 +96,17 @@ _CCCL_DIAG_PUSH \ _CCCL_DIAG_SUPPRESS_NVHPC(deprecated_entity) # define _CCCL_SUPPRESS_DEPRECATED_POP _CCCL_DIAG_POP -#elif defined(_CCCL_COMPILER_MSVC) +#elif _CCCL_COMPILER(MSVC) # define _CCCL_SUPPRESS_DEPRECATED_PUSH \ _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) && - // !_CCCL_COMPILER_MSVC + // !_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) && - // !_CCCL_COMPILER_MSVC + // !_CCCL_COMPILER(MSVC) // Enable us to selectively silence cuda compiler warnings #if defined(_CCCL_CUDA_COMPILER) @@ -114,31 +114,31 @@ # define _CCCL_NV_DIAG_SUPPRESS(_WARNING) # define _CCCL_NV_DIAG_DEFAULT(_WARNING) # elif defined(__NVCC_DIAG_PRAGMA_SUPPORT__) || _CCCL_COMPILER(ICC) -# if defined(_CCCL_COMPILER_MSVC) +# if _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) # else // ^^^ _CCCL_COMPILER_{MSVC,ICC}^^^ / vvv !_CCCL_COMPILER_{MSVC,ICC} vvv # define _CCCL_NV_DIAG_SUPPRESS(_WARNING) _CCCL_PRAGMA(nv_diagnostic push) _CCCL_PRAGMA(nv_diag_suppress _WARNING) # define _CCCL_NV_DIAG_DEFAULT(_WARNING) _CCCL_PRAGMA(nv_diagnostic pop) -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) # elif _CCCL_COMPILER(NVHPC) # define _CCCL_NV_DIAG_SUPPRESS(_WARNING) _CCCL_PRAGMA(diagnostic push) _CCCL_PRAGMA(diag_suppress _WARNING) # define _CCCL_NV_DIAG_DEFAULT(_WARNING) _CCCL_PRAGMA(diagnostic pop) # else // ^^^ __NVCC_DIAG_PRAGMA_SUPPORT__ ^^^ / vvv !__NVCC_DIAG_PRAGMA_SUPPORT__ vvv -# if defined(_CCCL_COMPILER_MSVC_2017) // MSVC 2017 has issues with restoring the warning +# if _CCCL_COMPILER(MSVC2017) // MSVC 2017 has issues with restoring the warning # define _CCCL_NV_DIAG_SUPPRESS(_WARNING) _CCCL_PRAGMA(diag_suppress _WARNING) # define _CCCL_NV_DIAG_DEFAULT(_WARNING) -# else // ^^^ _CCCL_COMPILER_MSVC_2017 ^^^ / vvv !_CCCL_COMPILER_MSVC_2017 vvv +# else // ^^^ _CCCL_COMPILER(MSVC2017) ^^^ / vvv !_CCCL_COMPILER(MSVC2017) vvv # define _CCCL_NV_DIAG_SUPPRESS(_WARNING) _CCCL_PRAGMA(diag_suppress _WARNING) # define _CCCL_NV_DIAG_DEFAULT(_WARNING) _CCCL_PRAGMA(diag_default _WARNING) -# endif // !_CCCL_COMPILER_MSVC_2017 +# endif // !_CCCL_COMPILER(MSVC2017) # endif // !__NVCC_DIAG_PRAGMA_SUPPORT__ #else // ^^^ _CCCL_CUDA_COMPILER ^^^ / vvv !_CCCL_CUDA_COMPILER vvv # define _CCCL_NV_DIAG_SUPPRESS(_WARNING) # define _CCCL_NV_DIAG_DEFAULT(_WARNING) #endif // other compilers -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # define _CCCL_HAS_PRAGMA_MSVC_WARNING # if !defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING) # define _CCCL_USE_PRAGMA_MSVC_WARNING @@ -160,13 +160,13 @@ # define _CCCL_MSVC_WARNINGS_PUSH \ _CCCL_PRAGMA(warning(push)) _CCCL_PRAGMA(warning(disable : _CCCL_MSVC_DISABLED_WARNINGS)) # define _CCCL_MSVC_WARNINGS_POP _CCCL_PRAGMA(warning(pop)) -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv # define _CCCL_MSVC_WARNINGS_PUSH # define _CCCL_MSVC_WARNINGS_POP -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) #ifndef _CCCL_HAS_NO_PRAGMA_PUSH_POP_MACRO -# if defined(_CCCL_COMPILER_MSVC_2017) || _CCCL_COMPILER(NVRTC) +# if _CCCL_COMPILER(MSVC2017) || _CCCL_COMPILER(NVRTC) # define _CCCL_HAS_NO_PRAGMA_PUSH_POP_MACRO # endif #endif // _CCCL_HAS_NO_PRAGMA_PUSH_POP_MACRO diff --git a/libcudacxx/include/cuda/std/__cccl/dialect.h b/libcudacxx/include/cuda/std/__cccl/dialect.h index 4b96695de73..8dfedd5a3cc 100644 --- a/libcudacxx/include/cuda/std/__cccl/dialect.h +++ b/libcudacxx/include/cuda/std/__cccl/dialect.h @@ -22,7 +22,7 @@ # pragma system_header #endif // no system header -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # if _MSVC_LANG <= 201103L # define _CCCL_STD_VER 2011 # elif _MSVC_LANG <= 201402L @@ -34,7 +34,7 @@ # else # define _CCCL_STD_VER 2023 // current year, or date of c++2b ratification # endif -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv # if __cplusplus <= 199711L # define _CCCL_STD_VER 2003 # elif __cplusplus <= 201103L @@ -50,7 +50,7 @@ # else # define _CCCL_STD_VER 2024 // current year, or date of c++2c ratification # endif -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) #if _CCCL_STD_VER >= 2014 # define _CCCL_CONSTEXPR_CXX14 constexpr diff --git a/libcudacxx/include/cuda/std/__cccl/exceptions.h b/libcudacxx/include/cuda/std/__cccl/exceptions.h index 24124bfa126..9f9e439e14e 100644 --- a/libcudacxx/include/cuda/std/__cccl/exceptions.h +++ b/libcudacxx/include/cuda/std/__cccl/exceptions.h @@ -25,8 +25,8 @@ #ifndef _CCCL_NO_EXCEPTIONS # if defined(CCCL_DISABLE_EXCEPTIONS) // Escape hatch for users to manually disable exceptions # define _CCCL_NO_EXCEPTIONS -# elif _CCCL_COMPILER(NVRTC) || (defined(_CCCL_COMPILER_MSVC) && _CPPUNWIND == 0) \ - || (!defined(_CCCL_COMPILER_MSVC) && !__EXCEPTIONS) // Catches all non msvc based compilers +# elif _CCCL_COMPILER(NVRTC) || (_CCCL_COMPILER(MSVC) && _CPPUNWIND == 0) \ + || (!_CCCL_COMPILER(MSVC) && !__EXCEPTIONS) // Catches all non msvc based compilers # define _CCCL_NO_EXCEPTIONS # endif #endif // !_CCCL_NO_EXCEPTIONS diff --git a/libcudacxx/include/cuda/std/__cccl/rtti.h b/libcudacxx/include/cuda/std/__cccl/rtti.h index 502407a0607..174b6313d87 100644 --- a/libcudacxx/include/cuda/std/__cccl/rtti.h +++ b/libcudacxx/include/cuda/std/__cccl/rtti.h @@ -38,7 +38,7 @@ # endif # elif _CCCL_COMPILER(NVRTC) # define _CCCL_NO_RTTI -# elif defined(_CCCL_COMPILER_MSVC) +# elif _CCCL_COMPILER(MSVC) # if _CPPRTTI == 0 # define _CCCL_NO_RTTI # endif @@ -65,7 +65,7 @@ # endif # elif _CCCL_COMPILER(NVRTC) # define _CCCL_NO_TYPEID -# elif defined(_CCCL_COMPILER_MSVC) +# elif _CCCL_COMPILER(MSVC) // No-op, MSVC always supports typeid even when RTTI is disabled # elif _CCCL_COMPILER(CLANG) # if !_CCCL_HAS_FEATURE(cxx_rtti) diff --git a/libcudacxx/include/cuda/std/__cccl/system_header.h b/libcudacxx/include/cuda/std/__cccl/system_header.h index 2285bcf1651..d557dc88682 100644 --- a/libcudacxx/include/cuda/std/__cccl/system_header.h +++ b/libcudacxx/include/cuda/std/__cccl/system_header.h @@ -19,19 +19,18 @@ # define _CCCL_FORCE_SYSTEM_HEADER_GCC #elif _CCCL_COMPILER(CLANG) # define _CCCL_FORCE_SYSTEM_HEADER_CLANG -#elif defined(_CCCL_COMPILER_MSVC) +#elif _CCCL_COMPILER(MSVC) # define _CCCL_FORCE_SYSTEM_HEADER_MSVC #endif // other compilers // Potentially enable that cccl headers are treated as system headers -#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_NO_SYSTEM_HEADER) && !(_CCCL_COMPILER(MSVC) && defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING)) \ + && !_CCCL_COMPILER(NVRTC) && !defined(_LIBCUDACXX_DISABLE_PRAGMA_GCC_SYSTEM_HEADER) # if _CCCL_COMPILER(GCC) || _CCCL_COMPILER(NVHPC) || _CCCL_COMPILER(ICC) # define _CCCL_IMPLICIT_SYSTEM_HEADER_GCC # elif _CCCL_COMPILER(CLANG) # define _CCCL_IMPLICIT_SYSTEM_HEADER_CLANG -# elif defined(_CCCL_COMPILER_MSVC) +# elif _CCCL_COMPILER(MSVC) # define _CCCL_IMPLICIT_SYSTEM_HEADER_MSVC # endif // other compilers #endif // Use system header diff --git a/libcudacxx/include/cuda/std/__cccl/unreachable.h b/libcudacxx/include/cuda/std/__cccl/unreachable.h index eb6ae9a63db..f92a042fb05 100644 --- a/libcudacxx/include/cuda/std/__cccl/unreachable.h +++ b/libcudacxx/include/cuda/std/__cccl/unreachable.h @@ -35,18 +35,18 @@ # define _CCCL_UNREACHABLE() __builtin_unreachable() # endif // CUDACC above 11.4 #else // ^^^ __CUDA_ARCH__ ^^^ / vvv !__CUDA_ARCH__ vvv -# if defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_COMPILER(MSVC2017) template _LIBCUDACXX_HIDE_FROM_ABI __declspec(noreturn) void __cccl_unreachable_fallback() { __assume(0); } # define _CCCL_UNREACHABLE() __cccl_unreachable_fallback() -# elif defined(_CCCL_COMPILER_MSVC) +# elif _CCCL_COMPILER(MSVC) # define _CCCL_UNREACHABLE() __assume(0) -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv # define _CCCL_UNREACHABLE() __builtin_unreachable() -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) #endif // !__CUDA_ARCH__ #endif // __CCCL_UNREACHABLE_H diff --git a/libcudacxx/include/cuda/std/__cccl/visibility.h b/libcudacxx/include/cuda/std/__cccl/visibility.h index ad35694a448..781e5a4fefa 100644 --- a/libcudacxx/include/cuda/std/__cccl/visibility.h +++ b/libcudacxx/include/cuda/std/__cccl/visibility.h @@ -37,21 +37,21 @@ #endif // _CCCL_COMPILER(NVHPC) // Enable us to hide kernels -#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) +#if _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_VISIBILITY_HIDDEN #else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ / vvv _CCCL_COMPILER(NVRTC) vvv # define _CCCL_VISIBILITY_HIDDEN __attribute__((__visibility__("hidden"))) #endif // !_CCCL_COMPILER(NVRTC) -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # define _CCCL_VISIBILITY_DEFAULT __declspec(dllimport) -#elif _CCCL_COMPILER(NVRTC) // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv _CCCL_COMPILER(NVRTC) vvv +#elif _CCCL_COMPILER(NVRTC) // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv _CCCL_COMPILER(NVRTC) vvv # define _CCCL_VISIBILITY_DEFAULT #else // ^^^ _CCCL_COMPILER(NVRTC) ^^^ / vvv !_CCCL_COMPILER(NVRTC) vvv # define _CCCL_VISIBILITY_DEFAULT __attribute__((__visibility__("default"))) #endif // !_CCCL_COMPILER(NVRTC) -#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) +#if _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) # define _CCCL_TYPE_VISIBILITY_DEFAULT #elif _CCCL_HAS_ATTRIBUTE(__type_visibility__) # define _CCCL_TYPE_VISIBILITY_DEFAULT __attribute__((__type_visibility__("default"))) @@ -59,11 +59,11 @@ # define _CCCL_TYPE_VISIBILITY_DEFAULT _CCCL_VISIBILITY_DEFAULT #endif // !_CCCL_COMPILER(NVRTC) -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # define _CCCL_FORCEINLINE __forceinline -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv _CCCL_COMPILER_MSVC vvv +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv _CCCL_COMPILER(MSVC) vvv # define _CCCL_FORCEINLINE __inline__ __attribute__((__always_inline__)) -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) #if _CCCL_HAS_ATTRIBUTE(exclude_from_explicit_instantiation) # define _CCCL_EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__((exclude_from_explicit_instantiation)) diff --git a/libcudacxx/include/cuda/std/__concepts/concept_macros.h b/libcudacxx/include/cuda/std/__concepts/concept_macros.h index 6dc147e9084..2850c38a493 100644 --- a/libcudacxx/include/cuda/std/__concepts/concept_macros.h +++ b/libcudacxx/include/cuda/std/__concepts/concept_macros.h @@ -78,14 +78,14 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool __is_true() return true; } -# if _CCCL_COMPILER(CLANG) || defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(CLANG) || _CCCL_COMPILER(MSVC) template _LIBCUDACXX_HIDE_FROM_ABI __cccl_enable_if_t<_Bp> __cccl_requires() {} -# else // ^^^ _CCCL_COMPILER(CLANG) || defined(_CCCL_COMPILER_MSVC) ^^^ / vvv other compilers vvv +# else // ^^^ _CCCL_COMPILER(CLANG) || _CCCL_COMPILER(MSVC) ^^^ / vvv other compilers vvv template = 0> _CCCL_INLINE_VAR constexpr int __cccl_requires = 0; -# endif // !_CCCL_COMPILER(CLANG) && !defined(_CCCL_COMPILER_MSVC) +# endif // !_CCCL_COMPILER(CLANG) && !_CCCL_COMPILER(MSVC) template _LIBCUDACXX_HIDE_FROM_ABI auto __cccl_make_dependent(_Tp*, _Tag<_Args...>*) -> _Tp; diff --git a/libcudacxx/include/cuda/std/__concepts/convertible_to.h b/libcudacxx/include/cuda/std/__concepts/convertible_to.h index 329b493b490..169383cb095 100644 --- a/libcudacxx/include/cuda/std/__concepts/convertible_to.h +++ b/libcudacxx/include/cuda/std/__concepts/convertible_to.h @@ -35,9 +35,9 @@ concept convertible_to = is_convertible_v<_From, _To> && requires { static_cast< #elif _CCCL_STD_VER >= 2014 // ^^^ C++20 ^^^ / vvv C++14/17 vvv -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) _CCCL_NV_DIAG_SUPPRESS(1211) // nonstandard cast to array type ignored -# endif // _CCCL_COMPILER_MSVC +# endif // _CCCL_COMPILER(MSVC) _CCCL_NV_DIAG_SUPPRESS(171) // invalid type conversion, e.g. [with _From=int **, _To=const int *const *] // We cannot put this conversion check with the other constraint, as types with deleted operator will break here @@ -55,9 +55,9 @@ _CCCL_CONCEPT_FRAGMENT( template _CCCL_CONCEPT convertible_to = _CCCL_FRAGMENT(__convertible_to_, _From, _To); -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) _CCCL_NV_DIAG_DEFAULT(1211) // nonstandard cast to array type ignored -# endif // _CCCL_COMPILER_MSVC +# endif // _CCCL_COMPILER(MSVC) _CCCL_NV_DIAG_DEFAULT(171) // invalid type conversion, e.g. [with _From=int **, _To=const int *const *] #endif // _CCCL_STD_VER >= 2014 diff --git a/libcudacxx/include/cuda/std/__concepts/destructible.h b/libcudacxx/include/cuda/std/__concepts/destructible.h index 421b5e41335..90426478490 100644 --- a/libcudacxx/include/cuda/std/__concepts/destructible.h +++ b/libcudacxx/include/cuda/std/__concepts/destructible.h @@ -32,12 +32,12 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD #if _CCCL_STD_VER > 2011 -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) template _CCCL_CONCEPT destructible = __is_nothrow_destructible(_Tp); -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv template _CCCL_INLINE_VAR constexpr bool __destructible_impl = false; @@ -67,7 +67,7 @@ _CCCL_INLINE_VAR constexpr bool __destructible<_Tp[_Nm]> = __destructible<_Tp>; template _CCCL_CONCEPT destructible = __destructible<_Tp>; -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) #endif // _CCCL_STD_VER > 2011 diff --git a/libcudacxx/include/cuda/std/__concepts/swappable.h b/libcudacxx/include/cuda/std/__concepts/swappable.h index 8635bc9cc6c..8688e71a702 100644 --- a/libcudacxx/include/cuda/std/__concepts/swappable.h +++ b/libcudacxx/include/cuda/std/__concepts/swappable.h @@ -37,9 +37,9 @@ #include #include -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) _CCCL_NV_DIAG_SUPPRESS(461) // nonstandard cast to array type ignored -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) #if _CCCL_STD_VER > 2011 @@ -199,8 +199,8 @@ _LIBCUDACXX_END_NAMESPACE_STD #endif // _CCCL_STD_VER > 2011 -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) _CCCL_NV_DIAG_DEFAULT(461) // nonstandard cast to array type ignored -#endif // _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(MSVC) #endif // _LIBCUDACXX___CONCEPTS_SWAPPABLE_H diff --git a/libcudacxx/include/cuda/std/__fwd/get.h b/libcudacxx/include/cuda/std/__fwd/get.h index 9280f9d45d3..6fd977fd158 100644 --- a/libcudacxx/include/cuda/std/__fwd/get.h +++ b/libcudacxx/include/cuda/std/__fwd/get.h @@ -72,7 +72,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 const _Tp&& get(const array<_Tp, _LIBCUDACXX_END_NAMESPACE_STD -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_BEGIN_NAMESPACE_RANGES @@ -109,6 +109,6 @@ using _CUDA_VRANGES::get; _LIBCUDACXX_END_NAMESPACE_STD -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX___FWD_GET_H diff --git a/libcudacxx/include/cuda/std/__fwd/subrange.h b/libcudacxx/include/cuda/std/__fwd/subrange.h index ba6b5e45ef5..d89df6f0ab2 100644 --- a/libcudacxx/include/cuda/std/__fwd/subrange.h +++ b/libcudacxx/include/cuda/std/__fwd/subrange.h @@ -22,7 +22,7 @@ #include -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_BEGIN_NAMESPACE_RANGES @@ -52,6 +52,6 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange; _LIBCUDACXX_END_NAMESPACE_RANGES_ABI _LIBCUDACXX_END_NAMESPACE_RANGES -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX___FWD_SUBRANGE_H diff --git a/libcudacxx/include/cuda/std/__iterator/concepts.h b/libcudacxx/include/cuda/std/__iterator/concepts.h index 59b2d0818dc..e4e507afe83 100644 --- a/libcudacxx/include/cuda/std/__iterator/concepts.h +++ b/libcudacxx/include/cuda/std/__iterator/concepts.h @@ -403,7 +403,7 @@ template _CCCL_CONCEPT bidirectional_iterator = _CCCL_FRAGMENT(__bidirectional_iterator_, _Ip); // [iterator.concept.random.access] -# if defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_COMPILER(MSVC2017) // For whatever reasons MSVC2017 cannot check decltype(__n + __j) template _CCCL_CONCEPT_FRAGMENT( @@ -415,7 +415,7 @@ _CCCL_CONCEPT_FRAGMENT( requires(same_as<_Ip&, decltype(__i -= __n)>), requires(same_as<_Ip, decltype(__j - __n)>), requires(same_as, decltype(__j[__n])>))); -# else // ^^^ _CCCL_COMPILER_MSVC_2017 ^^^ / vvv !_CCCL_COMPILER_MSVC_2017 vvv +# else // ^^^ _CCCL_COMPILER(MSVC2017) ^^^ / vvv !_CCCL_COMPILER(MSVC2017) vvv template _CCCL_CONCEPT_FRAGMENT( __random_access_iterator_operations_, @@ -426,7 +426,7 @@ _CCCL_CONCEPT_FRAGMENT( requires(same_as<_Ip&, decltype(__i -= __n)>), requires(same_as<_Ip, decltype(__j - __n)>), requires(same_as, decltype(__j[__n])>))); -# endif // !_CCCL_COMPILER_MSVC_2017 +# endif // !_CCCL_COMPILER(MSVC2017) template _CCCL_CONCEPT __random_access_iterator_operations = _CCCL_FRAGMENT(__random_access_iterator_operations_, _Ip); diff --git a/libcudacxx/include/cuda/std/__iterator/distance.h b/libcudacxx/include/cuda/std/__iterator/distance.h index 1e6fae1c988..441c30c9a9f 100644 --- a/libcudacxx/include/cuda/std/__iterator/distance.h +++ b/libcudacxx/include/cuda/std/__iterator/distance.h @@ -59,7 +59,7 @@ distance(_InputIter __first, _InputIter __last) } _LIBCUDACXX_END_NAMESPACE_STD -#if _CCCL_STD_VER > 2014 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER > 2014 && !_CCCL_COMPILER(MSVC2017) // [range.iter.op.distance] @@ -118,6 +118,6 @@ _CCCL_GLOBAL_CONSTANT auto distance = __distance::__fn{}; } // namespace __cpo _LIBCUDACXX_END_NAMESPACE_RANGES -#endif // _CCCL_STD_VER > 2014 && !defined(_CCCL_COMPILER_MSVC_2017) +#endif // _CCCL_STD_VER > 2014 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX___ITERATOR_DISTANCE_H diff --git a/libcudacxx/include/cuda/std/__iterator/iterator_traits.h b/libcudacxx/include/cuda/std/__iterator/iterator_traits.h index f20dde7d1b1..759af45cc3a 100644 --- a/libcudacxx/include/cuda/std/__iterator/iterator_traits.h +++ b/libcudacxx/include/cuda/std/__iterator/iterator_traits.h @@ -40,11 +40,11 @@ #include #if !_CCCL_COMPILER(NVRTC) -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) # include // for ::std::input_iterator_tag -# else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv # include // for ::std::input_iterator_tag -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) # if _CCCL_STD_VER >= 2020 template diff --git a/libcudacxx/include/cuda/std/__iterator/move_iterator.h b/libcudacxx/include/cuda/std/__iterator/move_iterator.h index 7e2e176b817..efdf656366a 100644 --- a/libcudacxx/include/cuda/std/__iterator/move_iterator.h +++ b/libcudacxx/include/cuda/std/__iterator/move_iterator.h @@ -107,7 +107,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator _Iter __current_; #if _CCCL_STD_VER >= 2017 -# if !defined(_CCCL_COMPILER_MSVC_2017) +# if !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_HIDE_FROM_ABI static constexpr auto __mi_get_iter_concept() { if constexpr (random_access_iterator<_Iter>) @@ -128,22 +128,22 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator } _CCCL_UNREACHABLE(); } -# endif // !_CCCL_COMPILER_MSVC_2017 +# endif // !_CCCL_COMPILER(MSVC2017) #endif // _CCCL_STD_VER >= 2017 public: #if _CCCL_STD_VER > 2014 using iterator_type = _Iter; -# if defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_COMPILER(MSVC2017) // clang-format off using iterator_concept = conditional_t, random_access_iterator_tag, conditional_t, bidirectional_iterator_tag, conditional_t, forward_iterator_tag, input_iterator_tag>>>; // clang-format on -# else // ^^^ _CCCL_COMPILER_MSVC_2017 ^^^ / vvv !_CCCL_COMPILER_MSVC_2017 vvv +# else // ^^^ _CCCL_COMPILER(MSVC2017) ^^^ / vvv !_CCCL_COMPILER(MSVC2017) vvv using iterator_concept = decltype(__mi_get_iter_concept()); -# endif // !_CCCL_COMPILER_MSVC_2017 +# endif // !_CCCL_COMPILER(MSVC2017) // iterator_category is inherited and not always present using value_type = iter_value_t<_Iter>; @@ -370,7 +370,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator return _CUDA_VRANGES::iter_move(__i.__current_); } -# if defined(_CCCL_COMPILER_MSVC_2017) // MSVC2017 cannot find _Iter otherwise +# if _CCCL_COMPILER(MSVC2017) // MSVC2017 cannot find _Iter otherwise template _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap( const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) noexcept(__noexcept_swappable<_Iter1, _Iter2>) @@ -378,7 +378,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator { return _CUDA_VRANGES::iter_swap(__x.__current_, __y.__current_); } -# else // ^^^ _CCCL_COMPILER_MSVC_2017 ^^^ / vvv !_CCCL_COMPILER_MSVC_2017 vvv +# else // ^^^ _CCCL_COMPILER(MSVC2017) ^^^ / vvv !_CCCL_COMPILER(MSVC2017) vvv template _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap(const move_iterator& __x, const move_iterator<_Iter2>& __y) noexcept(__noexcept_swappable<_Iter, _Iter2>) @@ -386,17 +386,17 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator { return _CUDA_VRANGES::iter_swap(__x.__current_, __y.__current_); } -# endif // !_CCCL_COMPILER_MSVC_2017 +# endif // !_CCCL_COMPILER(MSVC2017) #endif // _CCCL_STD_VER > 2014 }; _LIBCUDACXX_CTAD_SUPPORTED_FOR_TYPE(move_iterator); // Some compilers have issues determining _IsFancyPointer -#if _CCCL_COMPILER(GCC) || defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(GCC) || _CCCL_COMPILER(MSVC) template struct _IsFancyPointer> : _IsFancyPointer<_Iter> {}; -#endif // _CCCL_COMPILER(GCC) || _CCCL_COMPILER_MSVC +#endif // _CCCL_COMPILER(GCC) || _CCCL_COMPILER(MSVC) template _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 bool diff --git a/libcudacxx/include/cuda/std/__iterator/next.h b/libcudacxx/include/cuda/std/__iterator/next.h index 4651214e4bd..f100e76ec9d 100644 --- a/libcudacxx/include/cuda/std/__iterator/next.h +++ b/libcudacxx/include/cuda/std/__iterator/next.h @@ -42,7 +42,7 @@ next(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = _LIBCUDACXX_END_NAMESPACE_STD -#if _CCCL_STD_VER > 2014 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER > 2014 && !_CCCL_COMPILER(MSVC2017) // [range.iter.op.next] @@ -90,6 +90,6 @@ _CCCL_GLOBAL_CONSTANT auto next = __next::__fn{}; } // namespace __cpo _LIBCUDACXX_END_NAMESPACE_RANGES -#endif // _CCCL_STD_VER > 2014 && !defined(_CCCL_COMPILER_MSVC_2017) +#endif // _CCCL_STD_VER > 2014 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX___ITERATOR_NEXT_H diff --git a/libcudacxx/include/cuda/std/__iterator/prev.h b/libcudacxx/include/cuda/std/__iterator/prev.h index f28098d9e45..1e5e78d043e 100644 --- a/libcudacxx/include/cuda/std/__iterator/prev.h +++ b/libcudacxx/include/cuda/std/__iterator/prev.h @@ -41,7 +41,7 @@ prev(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = _LIBCUDACXX_END_NAMESPACE_STD -#if _CCCL_STD_VER > 2014 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER > 2014 && !_CCCL_COMPILER(MSVC2017) // [range.iter.op.prev] @@ -81,6 +81,6 @@ _CCCL_GLOBAL_CONSTANT auto prev = __prev::__fn{}; } // namespace __cpo _LIBCUDACXX_END_NAMESPACE_RANGES -#endif // _CCCL_STD_VER > 2014 && !defined(_CCCL_COMPILER_MSVC_2017) +#endif // _CCCL_STD_VER > 2014 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX___ITERATOR_PREV_H diff --git a/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h b/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h index 6f2b0cce65e..982312731f9 100644 --- a/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h +++ b/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h @@ -248,7 +248,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT reverse_iterator return _CUDA_VRANGES::iter_move(--__tmp); } -# if defined(_CCCL_COMPILER_MSVC_2017) // MSVC2017 cannot find _Iter otherwise +# if _CCCL_COMPILER(MSVC2017) // MSVC2017 cannot find _Iter otherwise template _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap(const reverse_iterator<_Iter1>& __x, @@ -259,7 +259,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT reverse_iterator auto __ytmp = __y.base(); _CUDA_VRANGES::iter_swap(--__xtmp, --__ytmp); } -# else // ^^^ _CCCL_COMPILER_MSVC_2017 ^^^ / vvv !_CCCL_COMPILER_MSVC_2017 vvv +# else // ^^^ _CCCL_COMPILER(MSVC2017) ^^^ / vvv !_CCCL_COMPILER(MSVC2017) vvv template _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap(const reverse_iterator& __x, @@ -270,7 +270,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT reverse_iterator auto __ytmp = __y.base(); return _CUDA_VRANGES::iter_swap(--__xtmp, --__ytmp); } -# endif // !_CCCL_COMPILER_MSVC_2017 +# endif // !_CCCL_COMPILER(MSVC2017) #endif // _CCCL_STD_VER > 2014 }; diff --git a/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h b/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h index 785c6d149c9..3ffffea090c 100644 --- a/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h +++ b/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h @@ -35,12 +35,12 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES_ABI // are only ever found through ADL struct unreachable_sentinel_t -# ifdef _CCCL_COMPILER_MSVC +# if _CCCL_COMPILER(MSVC) ; namespace __unreachable_sentinel_detail { struct __unreachable_base -# endif // _CCCL_COMPILER_MSVC +# endif // _CCCL_COMPILER(MSVC) { _CCCL_TEMPLATE(class _Iter) _CCCL_REQUIRES(weakly_incrementable<_Iter>) @@ -74,11 +74,11 @@ struct __unreachable_base # endif // _CCCL_STD_VER < 2020 }; -# ifdef _CCCL_COMPILER_MSVC +# if _CCCL_COMPILER(MSVC) } // namespace __unreachable_sentinel_detail struct unreachable_sentinel_t : __unreachable_sentinel_detail::__unreachable_base {}; -# endif // _CCCL_COMPILER_MSVC +# endif // _CCCL_COMPILER(MSVC) _LIBCUDACXX_END_NAMESPACE_RANGES_ABI diff --git a/libcudacxx/include/cuda/std/__memory/assume_aligned.h b/libcudacxx/include/cuda/std/__memory/assume_aligned.h index c8f9310ed1a..ce7b70e6a01 100644 --- a/libcudacxx/include/cuda/std/__memory/assume_aligned.h +++ b/libcudacxx/include/cuda/std/__memory/assume_aligned.h @@ -36,9 +36,9 @@ _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 _Tp* assume_alig #if defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED) && defined(_CCCL_BUILTIN_ASSUME_ALIGNED) if (!_CCCL_BUILTIN_IS_CONSTANT_EVALUATED()) { -# if !defined(_CCCL_COMPILER_MSVC) // MSVC checks within the builtin +# if !_CCCL_COMPILER(MSVC) // MSVC checks within the builtin _CCCL_ASSERT(reinterpret_cast(__ptr) % _Align == 0, "Alignment assumption is violated"); -# endif // !_CCCL_COMPILER_MSVC +# endif // !_CCCL_COMPILER(MSVC) return static_cast<_Tp*>(_CCCL_BUILTIN_ASSUME_ALIGNED(__ptr, _Align)); } else diff --git a/libcudacxx/include/cuda/std/__ranges/access.h b/libcudacxx/include/cuda/std/__ranges/access.h index 9a18ddd88b6..2c1525e1ad4 100644 --- a/libcudacxx/include/cuda/std/__ranges/access.h +++ b/libcudacxx/include/cuda/std/__ranges/access.h @@ -33,7 +33,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER > 2014 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER > 2014 && !_CCCL_COMPILER(MSVC2017) template _CCCL_CONCEPT __can_borrow = is_lvalue_reference_v<_Tp> || enable_borrowed_range>; @@ -279,7 +279,7 @@ inline namespace __cpo { _CCCL_GLOBAL_CONSTANT auto cend = __cend::__fn{}; } // namespace __cpo -#endif // _CCCL_STD_VER > 2014 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER > 2014 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/concepts.h b/libcudacxx/include/cuda/std/__ranges/concepts.h index 8b4aa426b51..26d7fe421e7 100644 --- a/libcudacxx/include/cuda/std/__ranges/concepts.h +++ b/libcudacxx/include/cuda/std/__ranges/concepts.h @@ -44,7 +44,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) # if _CCCL_STD_VER >= 2020 @@ -301,7 +301,7 @@ template _CCCL_CONCEPT __container_compatible_range = _CCCL_FRAGMENT(__container_compatible_range_, _Range, _Tp); # endif // _CCCL_STD_VER <= 2017 -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/dangling.h b/libcudacxx/include/cuda/std/__ranges/dangling.h index e0974298c03..b97e5e5555a 100644 --- a/libcudacxx/include/cuda/std/__ranges/dangling.h +++ b/libcudacxx/include/cuda/std/__ranges/dangling.h @@ -27,7 +27,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) struct dangling { @@ -47,7 +47,7 @@ using borrowed_iterator_t = enable_if_t, _If, ite // borrowed_subrange_t defined in <__ranges/subrange.h> -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/data.h b/libcudacxx/include/cuda/std/__ranges/data.h index 0e949a12489..f5bf6015963 100644 --- a/libcudacxx/include/cuda/std/__ranges/data.h +++ b/libcudacxx/include/cuda/std/__ranges/data.h @@ -34,7 +34,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) // [range.prim.data] @@ -128,7 +128,7 @@ inline namespace __cpo _CCCL_GLOBAL_CONSTANT auto cdata = __cdata::__fn{}; } // namespace __cpo -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/empty.h b/libcudacxx/include/cuda/std/__ranges/empty.h index 9eee04a6644..d8f8213e9a8 100644 --- a/libcudacxx/include/cuda/std/__ranges/empty.h +++ b/libcudacxx/include/cuda/std/__ranges/empty.h @@ -27,7 +27,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) // [range.prim.empty] @@ -104,7 +104,7 @@ inline namespace __cpo _CCCL_GLOBAL_CONSTANT auto empty = __empty::__fn{}; } // namespace __cpo -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/rbegin.h b/libcudacxx/include/cuda/std/__ranges/rbegin.h index 671e8e31798..8b70f702797 100644 --- a/libcudacxx/include/cuda/std/__ranges/rbegin.h +++ b/libcudacxx/include/cuda/std/__ranges/rbegin.h @@ -33,7 +33,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) // [ranges.access.rbegin] @@ -168,7 +168,7 @@ inline namespace __cpo _CCCL_GLOBAL_CONSTANT auto crbegin = __crbegin::__fn{}; } // namespace __cpo -#endif // _CCCL_STD_VER >= 2017 && && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/rend.h b/libcudacxx/include/cuda/std/__ranges/rend.h index 28ec5e9e021..5c266d63bdd 100644 --- a/libcudacxx/include/cuda/std/__ranges/rend.h +++ b/libcudacxx/include/cuda/std/__ranges/rend.h @@ -34,7 +34,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) // [range.access.rend] @@ -174,7 +174,7 @@ inline namespace __cpo _CCCL_GLOBAL_CONSTANT auto crend = __crend::__fn{}; } // namespace __cpo -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/size.h b/libcudacxx/include/cuda/std/__ranges/size.h index 0c87e1c1ef3..04487441586 100644 --- a/libcudacxx/include/cuda/std/__ranges/size.h +++ b/libcudacxx/include/cuda/std/__ranges/size.h @@ -36,7 +36,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) template _CCCL_INLINE_VAR constexpr bool disable_sized_range = false; @@ -200,7 +200,7 @@ inline namespace __cpo _CCCL_GLOBAL_CONSTANT auto ssize = __ssize::__fn{}; } // namespace __cpo -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/subrange.h b/libcudacxx/include/cuda/std/__ranges/subrange.h index a9eb9f2572f..190df21d43b 100644 --- a/libcudacxx/include/cuda/std/__ranges/subrange.h +++ b/libcudacxx/include/cuda/std/__ranges/subrange.h @@ -51,7 +51,7 @@ #include #include -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) // MSVC complains about [[msvc::no_unique_address]] prior to C++20 as a vendor extension _CCCL_DIAG_PUSH @@ -514,6 +514,6 @@ _LIBCUDACXX_END_NAMESPACE_STD _CCCL_DIAG_POP -#endif // _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX___RANGES_SUBRANGE_H diff --git a/libcudacxx/include/cuda/std/__ranges/unwrap_end.h b/libcudacxx/include/cuda/std/__ranges/unwrap_end.h index f134f141e8f..9e0b6636ff0 100644 --- a/libcudacxx/include/cuda/std/__ranges/unwrap_end.h +++ b/libcudacxx/include/cuda/std/__ranges/unwrap_end.h @@ -27,7 +27,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _Range) _CCCL_REQUIRES(forward_range<_Range>) @@ -46,7 +46,7 @@ _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator_t<_Range> __unwrap_ _CCCL_UNREACHABLE(); } -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/view_interface.h b/libcudacxx/include/cuda/std/__ranges/view_interface.h index f7f14b53c09..661e20c1b68 100644 --- a/libcudacxx/include/cuda/std/__ranges/view_interface.h +++ b/libcudacxx/include/cuda/std/__ranges/view_interface.h @@ -37,7 +37,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) # if _CCCL_STD_VER >= 2020 template @@ -178,7 +178,7 @@ class view_interface _LIBCUDACXX_END_NAMESPACE_RANGES_ABI -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_END_NAMESPACE_RANGES diff --git a/libcudacxx/include/cuda/std/__ranges/views.h b/libcudacxx/include/cuda/std/__ranges/views.h index 8941de6c14d..3954877f117 100644 --- a/libcudacxx/include/cuda/std/__ranges/views.h +++ b/libcudacxx/include/cuda/std/__ranges/views.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_BEGIN_NAMESPACE_VIEWS @@ -33,6 +33,6 @@ namespace views = ranges::views; _LIBCUDACXX_END_NAMESPACE_STD -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX___RANGES_VIEWS diff --git a/libcudacxx/include/cuda/std/__tuple_dir/structured_bindings.h b/libcudacxx/include/cuda/std/__tuple_dir/structured_bindings.h index 8c381a9af91..e054f78729e 100644 --- a/libcudacxx/include/cuda/std/__tuple_dir/structured_bindings.h +++ b/libcudacxx/include/cuda/std/__tuple_dir/structured_bindings.h @@ -157,7 +157,7 @@ struct tuple_element<_Ip, const volatile _CUDA_VSTD::tuple<_Tp...>> : _CUDA_VSTD::tuple_element<_Ip, const volatile _CUDA_VSTD::tuple<_Tp...>> {}; -# if !defined(_CCCL_COMPILER_MSVC_2017) +# if !_CCCL_COMPILER(MSVC2017) template struct tuple_size<_CUDA_VRANGES::subrange<_Ip, _Sp, _Kp>> : _CUDA_VSTD::tuple_size<_CUDA_VRANGES::subrange<_Ip, _Sp, _Kp>> @@ -197,7 +197,7 @@ template struct tuple_element<_Idx, const volatile _CUDA_VRANGES::subrange<_Ip, _Sp, _Kp>> : _CUDA_VSTD::tuple_element<_Idx, const volatile _CUDA_VRANGES::subrange<_Ip, _Sp, _Kp>> {}; -# endif // !_CCCL_COMPILER_MSVC_2017 +# endif // !_CCCL_COMPILER(MSVC2017) } // namespace std #endif // _CCCL_STD_VER >= 2017 diff --git a/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h b/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h index b1f2273b035..28a6b1dada9 100644 --- a/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h +++ b/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h @@ -56,11 +56,11 @@ template struct __tuple_like> : true_type {}; -#if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) template struct __tuple_like<_CUDA_VRANGES::subrange<_Ip, _Sp, _Kp>> : true_type {}; -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) template struct __tuple_like<__tuple_types<_Tp...>> : true_type diff --git a/libcudacxx/include/cuda/std/__type_traits/common_reference.h b/libcudacxx/include/cuda/std/__type_traits/common_reference.h index 020925bfb2c..6f62a1033ef 100644 --- a/libcudacxx/include/cuda/std/__type_traits/common_reference.h +++ b/libcudacxx/include/cuda/std/__type_traits/common_reference.h @@ -42,7 +42,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD // common_reference // Let COND_RES(X, Y) be: -#ifdef _CCCL_COMPILER_MSVC // Workaround for DevCom-1627396 +#if _CCCL_COMPILER(MSVC) // Workaround for DevCom-1627396 template _Tp __returns_exactly() noexcept; // not defined @@ -67,10 +67,10 @@ struct __cond_res_workaround<_Tp, _Up, void_t<__cond_res_if_right<_Tp, _Up>>> template using __cond_res = typename __cond_res_workaround<_Xp, _Yp>::type; -#else // ^^^ MSVC ^^^ / vvv !MSVC vvv +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv template using __cond_res = decltype(false ? _CUDA_VSTD::declval<_Xp (&)()>()() : _CUDA_VSTD::declval<_Yp (&)()>()()); -#endif // !MSVC +#endif // !_CCCL_COMPILER(MSVC) // Let `XREF(A)` denote a unary alias template `T` such that `T` denotes the same type as `U` // with the addition of `A`'s cv and reference qualifiers, for a non-reference cv-unqualified type diff --git a/libcudacxx/include/cuda/std/__type_traits/common_type.h b/libcudacxx/include/cuda/std/__type_traits/common_type.h index 319d6fb7143..09067b52084 100644 --- a/libcudacxx/include/cuda/std/__type_traits/common_type.h +++ b/libcudacxx/include/cuda/std/__type_traits/common_type.h @@ -90,11 +90,11 @@ struct __common_type2_imp : __common_type3<_Tp, _Up> // branches have diverging return types, this happens for extended floating point types template using __msvc_declval_workaround = -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) enable_if_t<_CCCL_TRAIT(is_same, __cond_type<_Tp, _Up>, __cond_type<_Up, _Tp>)>; -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv void; -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) // sub-bullet 3 - "if decay_t() : declval())> ..." template diff --git a/libcudacxx/include/cuda/std/__type_traits/disjunction.h b/libcudacxx/include/cuda/std/__type_traits/disjunction.h index 01fe64735a5..61bfca3f428 100644 --- a/libcudacxx/include/cuda/std/__type_traits/disjunction.h +++ b/libcudacxx/include/cuda/std/__type_traits/disjunction.h @@ -51,7 +51,7 @@ struct _OrImpl template using _Or _CCCL_NODEBUG_ALIAS = typename _OrImpl::template _Result; -#ifdef _CCCL_COMPILER_MSVC +#if _CCCL_COMPILER(MSVC) template struct disjunction : false_type {}; @@ -63,7 +63,7 @@ struct disjunction<_First, _Rest...> : _OrImpl::template _Result struct disjunction : _Or<_Args...> {}; -#endif // !MSVC +#endif // !_CCCL_COMPILER(MSVC) #if !defined(_CCCL_NO_VARIABLE_TEMPLATES) template diff --git a/libcudacxx/include/cuda/std/__type_traits/is_convertible.h b/libcudacxx/include/cuda/std/__type_traits/is_convertible.h index 11b16014cb8..4fbcb82deb6 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_convertible.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_convertible.h @@ -43,7 +43,7 @@ template _CCCL_INLINE_VAR constexpr bool is_convertible_v = _CCCL_BUILTIN_IS_CONVERTIBLE_TO(_T1, _T2); # endif // !_CCCL_NO_VARIABLE_TEMPLATES -# ifdef _CCCL_COMPILER_MSVC // Workaround for DevCom-1627396 +# if _CCCL_COMPILER(MSVC) // Workaround for DevCom-1627396 template struct is_convertible<_Ty&, volatile _Ty&> : true_type {}; @@ -71,7 +71,7 @@ _CCCL_INLINE_VAR constexpr bool is_convertible_v<_Ty&, const volatile _Ty&> = tr template _CCCL_INLINE_VAR constexpr bool is_convertible_v = true; -# endif // _CCCL_COMPILER_MSVC +# endif // _CCCL_COMPILER(MSVC) #else // ^^^ _CCCL_BUILTIN_IS_CONVERTIBLE_TO ^^^ / vvv !_CCCL_BUILTIN_IS_CONVERTIBLE_TO vvv diff --git a/libcudacxx/include/cuda/std/__type_traits/is_primary_template.h b/libcudacxx/include/cuda/std/__type_traits/is_primary_template.h index 9c6a7ebc53d..d9d536d2b80 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_primary_template.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_primary_template.h @@ -27,7 +27,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) template struct __is_primary_template : false_type {}; @@ -37,13 +37,13 @@ struct __is_primary_template<_Tp, void_t> : public is_same<_Tp, typename _Tp::__primary_template> {}; -#else // ^^^ _CCCL_COMPILER_MSVC ^^^ / vvv !_CCCL_COMPILER_MSVC vvv +#else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv template using __test_for_primary_template = enable_if_t<_IsSame<_Tp, typename _Tp::__primary_template>::value>; template using __is_primary_template = _IsValidExpansion<__test_for_primary_template, _Tp>; -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) _LIBCUDACXX_END_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/__type_traits/type_list.h b/libcudacxx/include/cuda/std/__type_traits/type_list.h index 4bd928b0013..00f69273673 100644 --- a/libcudacxx/include/cuda/std/__type_traits/type_list.h +++ b/libcudacxx/include/cuda/std/__type_traits/type_list.h @@ -559,7 +559,7 @@ using __type_back = __type_at_c<_List::__size - 1, _List>; namespace __detail { -# if defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION < 1938 +# if _CCCL_COMPILER(MSVC, <, 19, 38) // A workaround for https://developercommunity.visualstudio.com/t/fatal-error-C1001:-Internal-compiler-err/10405847 struct __type_concat_fn { @@ -586,7 +586,7 @@ struct __type_concat_fn template using __call _CCCL_NODEBUG_ALIAS = __type<__trait<_Lists...>>; }; -# else // ^^^ _CCCL_COMPILER_MSVC < 19.38 ^^^ / vvv !(_CCCL_COMPILER_MSVC < 19.38) vvv +# else // ^^^ _CCCL_COMPILER(MSVC, <, 19, 38) ^^^ / vvv _CCCL_COMPILER(MSVC, >=, 19, 38) vvv template struct _CCCL_TYPE_VISIBILITY_DEFAULT __type_maybe_concat_fn { @@ -646,7 +646,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT __type_concat_fn __type_list_ptr<>{nullptr}, __type_list_ptr<>{nullptr})); }; -# endif // !(_CCCL_COMPILER_MSVC < 19.38) +# endif // _CCCL_COMPILER(MSVC, >=, 19, 38) } // namespace __detail //! \brief Concatenate a list of type lists into a single type list. diff --git a/libcudacxx/include/cuda/std/__type_traits/type_set.h b/libcudacxx/include/cuda/std/__type_traits/type_set.h index e73c6161070..c83ebd06af7 100644 --- a/libcudacxx/include/cuda/std/__type_traits/type_set.h +++ b/libcudacxx/include/cuda/std/__type_traits/type_set.h @@ -84,7 +84,7 @@ struct __bulk_insert template <> struct __bulk_insert { -#if defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION < 1920 +#if _CCCL_COMPILER(MSVC, <, 19, 20) template _LIBCUDACXX_HIDE_FROM_ABI static auto __insert_fn(__type_list<_Ty, _Us...>*) -> typename __bulk_insert::template __call, _Us...>; diff --git a/libcudacxx/include/cuda/std/__utility/auto_cast.h b/libcudacxx/include/cuda/std/__utility/auto_cast.h index ad4107ab178..b766493501f 100644 --- a/libcudacxx/include/cuda/std/__utility/auto_cast.h +++ b/libcudacxx/include/cuda/std/__utility/auto_cast.h @@ -23,7 +23,7 @@ #include -#if _CCCL_STD_VER < 2020 && defined(_CCCL_COMPILER_MSVC) +#if _CCCL_STD_VER < 2020 && _CCCL_COMPILER(MSVC) # define _LIBCUDACXX_AUTO_CAST(expr) (_CUDA_VSTD::decay_t) (expr) #else # define _LIBCUDACXX_AUTO_CAST(expr) static_cast<_CUDA_VSTD::decay_t>(expr) diff --git a/libcudacxx/include/cuda/std/__utility/declval.h b/libcudacxx/include/cuda/std/__utility/declval.h index 96499be6e67..d7f701c201a 100644 --- a/libcudacxx/include/cuda/std/__utility/declval.h +++ b/libcudacxx/include/cuda/std/__utility/declval.h @@ -30,8 +30,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD // MSVC < 19.39 to miscompile so we use the fallback instead. The use of the // `__identity_t` alias is help MSVC parse the declaration correctly. #if !defined(_CCCL_NO_VARIABLE_TEMPLATES) && !defined(_CCCL_NO_NOEXCEPT_FUNCTION_TYPE) \ - && !(defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(12, 4)) \ - && !(defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION < 1939) + && !(defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(12, 4)) && !_CCCL_COMPILER(MSVC, <, 19, 39) template using __identity_t _CCCL_NODEBUG_ALIAS = _Tp; diff --git a/libcudacxx/include/cuda/std/bitset b/libcudacxx/include/cuda/std/bitset index 7c9839bc043..60d0e912c80 100644 --- a/libcudacxx/include/cuda/std/bitset +++ b/libcudacxx/include/cuda/std/bitset @@ -526,15 +526,15 @@ protected: _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 unsigned long to_ulong() const { -#ifdef _CCCL_COMPILER_MSVC +#if _CCCL_COMPILER(MSVC) if (static_cast(__first_.__data) != __first_.__data) { _CUDA_VSTD::__throw_overflow_error("bitset to_ulong overflow error"); } return static_cast(__first_.__data); -#else // ^^ MSVC ^^ | vv !MSVC vv +#else // ^^ _CCCL_COMPILER(MSVC) ^^ | vv !_CCCL_COMPILER(MSVC) vv return __first_.__data; -#endif // !MSVC +#endif // !_CCCL_COMPILER(MSVC) } _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 unsigned long long to_ullong() const diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/__config b/libcudacxx/include/cuda/std/detail/libcxx/include/__config index 2cdeeb4c1ef..2944ef6d4c8 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/__config +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/__config @@ -115,7 +115,7 @@ extern "C++" { # elif defined(_LIBCUDACXX_ABI_FORCE_MICROSOFT) # define _LIBCUDACXX_ABI_MICROSOFT # else -# if defined(_WIN32) && defined(_CCCL_COMPILER_MSVC) +# if defined(_WIN32) && _CCCL_COMPILER(MSVC) # define _LIBCUDACXX_ABI_MICROSOFT # else # define _LIBCUDACXX_ABI_ITANIUM @@ -186,7 +186,7 @@ extern "C++" { # define _LIBCUDACXX_MSVCRT_LIKE // If mingw not explicitly detected, assume using MS C runtime only if // a MS compatibility version is specified. -# if defined(_CCCL_COMPILER_MSVC) && !defined(__MINGW32__) +# if _CCCL_COMPILER(MSVC) && !defined(__MINGW32__) # define _LIBCUDACXX_MSVCRT // Using Microsoft's C Runtime library # endif # if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__)) @@ -287,14 +287,14 @@ extern "C++" { # define __alignof(x) alignof(x) # endif // _CCCL_COMPILER(NVRTC) -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) # define __alignof__ __alignof # endif # define _LIBCUDACXX_ALIGNOF(_Tp) alignof(_Tp) # define _LIBCUDACXX_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp) -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) # define _CCCL_ALIGNAS_TYPE(x) alignas(x) # define _CCCL_ALIGNAS(x) __declspec(align(x)) # elif _CCCL_HAS_FEATURE(cxx_alignas) @@ -303,7 +303,7 @@ extern "C++" { # else # define _CCCL_ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCUDACXX_ALIGNOF(x)))) # define _CCCL_ALIGNAS(x) __attribute__((__aligned__(x))) -# endif // !_CCCL_COMPILER_MSVC && !_CCCL_HAS_FEATURE(cxx_alignas) +# endif // !_CCCL_COMPILER(MSVC) && !_CCCL_HAS_FEATURE(cxx_alignas) // This is wrapped in __CUDA_ARCH__ to prevent error: "ignoring '#pragma unroll' // [-Werror=unknown-pragmas]" @@ -389,7 +389,7 @@ typedef __char32_t char32_t; # define _LIBCUDACXX_DISABLE_EXTENSION_WARNING __extension__ -# elif defined(_CCCL_COMPILER_MSVC) +# elif _CCCL_COMPILER(MSVC) # define _LIBCUDACXX_WARNING(x) _CCCL_PRAGMA(message(__FILE__ "(" _CCCL_TO_STRING(__LINE__) ") : warning note: " x)) @@ -461,7 +461,7 @@ typedef __char32_t char32_t; # endif // _LIBCUDACXX_HAS_NO_CXX20_CHRONO_LITERALS # ifndef _LIBCUDACXX_HAS_NO_INT128 -# if defined(_CCCL_COMPILER_MSVC) || (_CCCL_COMPILER(NVRTC) && !defined(__CUDACC_RTC_INT128__)) \ +# if _CCCL_COMPILER(MSVC) || (_CCCL_COMPILER(NVRTC) && !defined(__CUDACC_RTC_INT128__)) \ || (defined(_CCCL_CUDA_COMPILER_NVCC) && _CCCL_CUDACC_BELOW(11, 5)) || !defined(__SIZEOF_INT128__) # define _LIBCUDACXX_HAS_NO_INT128 # endif @@ -605,7 +605,7 @@ typedef unsigned int char32_t; // If we are getting operator new from the MSVC CRT, then allocation overloads // for align_val_t were added in 19.12, aka VS 2017 version 15.3. -# if defined(_LIBCUDACXX_MSVCRT) && defined(_CCCL_COMPILER_MSVC) && _MSC_VER < 1912 +# if defined(_LIBCUDACXX_MSVCRT) && _CCCL_COMPILER(MSVC, <, 19, 12) # define _LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION # elif defined(_LIBCUDACXX_ABI_VCRUNTIME) && !defined(__cpp_aligned_new) // We're deferring to Microsoft's STL to provide aligned new et al. We don't @@ -681,7 +681,7 @@ typedef unsigned int char32_t; # endif // _LIBCUDACXX_HAS_THREAD_API_CUDA # ifndef _LIBCUDACXX_HAS_THREAD_API_WIN32 -# if defined(_CCCL_COMPILER_MSVC) && !defined(_LIBCUDACXX_HAS_THREAD_API_CUDA) +# if _CCCL_COMPILER(MSVC) && !defined(_LIBCUDACXX_HAS_THREAD_API_CUDA) # define _LIBCUDACXX_HAS_THREAD_API_WIN32 # endif # endif // _LIBCUDACXX_HAS_THREAD_API_WIN32 @@ -744,7 +744,7 @@ typedef unsigned int char32_t; # define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP # elif _CCCL_COMPILER(NVHPC) # define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP -# elif defined(_CCCL_COMPILER_MSVC) +# elif _CCCL_COMPILER(MSVC) # define _LIBCUDACXX_HAS_MSVC_ATOMIC_IMPL # endif @@ -800,7 +800,7 @@ typedef unsigned int char32_t; # define _LIBCUDACXX_PREFERRED_NAME(x) # endif -# if defined(_LIBCUDACXX_ABI_MICROSOFT) && (defined(_CCCL_COMPILER_MSVC) || __has_declspec_attribute(empty_bases)) +# if defined(_LIBCUDACXX_ABI_MICROSOFT) && (_CCCL_COMPILER(MSVC) || __has_declspec_attribute(empty_bases)) # define _LIBCUDACXX_DECLSPEC_EMPTY_BASES __declspec(empty_bases) # else # define _LIBCUDACXX_DECLSPEC_EMPTY_BASES @@ -822,7 +822,7 @@ typedef unsigned int char32_t; # define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS # elif _CCCL_COMPILER(NVRTC) # define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS -# elif defined(_CCCL_COMPILER_MSVC) +# elif _CCCL_COMPILER(MSVC) # define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS # elif _CCCL_CUDACC_BELOW(11, 8) # define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/climits b/libcudacxx/include/cuda/std/detail/libcxx/include/climits index ffe87d1caf0..f5b285ccc25 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/climits +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/climits @@ -51,7 +51,7 @@ Macros: _CCCL_PUSH_MACROS -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # include #endif // _LIBCUDACXX_MSVCRT diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/cmath b/libcudacxx/include/cuda/std/detail/libcxx/include/cmath index bf0f4da10f5..7066ddec4f2 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/cmath +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/cmath @@ -683,7 +683,7 @@ __constexpr_isfinite(_A1 __lcpp_x) noexcept return isfinite(__lcpp_x); } -#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) +#if _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_copysign(_A1 __x, _A1 __y) noexcept { @@ -715,9 +715,9 @@ __constexpr_copysign(_A1 __x, _A2 __y) noexcept static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), ""); return __builtin_copysign((__result_type) __x, (__result_type) __y); } -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) -#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) +#if _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_fabs(_A1 __x) noexcept { @@ -744,9 +744,9 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 double __constexpr_fabs(_Tp __x) { return __builtin_fabs(static_cast(__x)); } -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) -#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) +#if _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) template _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_fmax(_A1 __x, _A1 __y) noexcept { @@ -829,9 +829,9 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX __promote_t<_Tp, _Up> __ using __result_type = __promote_t<_Tp, _Up>; return _CUDA_VSTD::__constexpr_fmax(static_cast<__result_type>(__x), static_cast<__result_type>(__y)); } -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) -#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) || defined(_CCCL_CUDA_COMPILER_CLANG) +#if _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) || defined(_CCCL_CUDA_COMPILER_CLANG) template _LIBCUDACXX_HIDE_FROM_ABI _A1 __constexpr_logb(_A1 __x) { @@ -874,7 +874,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX _Tp __constexpr_logb(_Tp } #endif // !_MSVC -#if defined(_CCCL_COMPILER_MSVC) || _CCCL_COMPILER(NVRTC) || defined(_CCCL_CUDA_COMPILER_CLANG) +#if _CCCL_COMPILER(MSVC) || _CCCL_COMPILER(NVRTC) || defined(_CCCL_CUDA_COMPILER_CLANG) template _LIBCUDACXX_HIDE_FROM_ABI _Tp __constexpr_scalbn(_Tp __x, int __i) { @@ -958,7 +958,7 @@ _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14_COMPLEX _Tp __constexpr_scalbn(_ # endif // defined(_CCCL_BUILTIN_IS_CONSTANT_EVALUATED) return __builtin_scalbn(__x, __exp); } -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) #if _CCCL_STD_VER > 2017 template diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/limits b/libcudacxx/include/cuda/std/detail/libcxx/include/limits index 06845b5f664..ea830da6046 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/limits +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/limits @@ -118,7 +118,7 @@ template<> class numeric_limits; _CCCL_PUSH_MACROS -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # include #endif // _LIBCUDACXX_MSVCRT diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/span b/libcudacxx/include/cuda/std/detail/libcxx/include/span index afe5ea34519..75774146c09 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/span +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/span @@ -203,9 +203,9 @@ template _CCCL_CONCEPT __span_array_convertible = _CCCL_TRAIT(is_convertible, _From (*)[], _To (*)[]); // We want to ensure that span interacts nicely with containers that might not have had the ranges treatment -# if defined(__cpp_lib_ranges) && !defined(_CCCL_COMPILER_MSVC_2017) +# if defined(__cpp_lib_ranges) && !_CCCL_COMPILER(MSVC2017) # define _CCCL_SPAN_USES_RANGES -# endif // __cpp_lib_ranges && !_CCCL_COMPILER_MSVC_2017 +# endif // __cpp_lib_ranges && !_CCCL_COMPILER(MSVC2017) # if defined(_CCCL_SPAN_USES_RANGES) template @@ -367,7 +367,7 @@ public: } # endif // !_CCCL_SPAN_USES_RANGES -# if _CCCL_COMPILER(NVRTC) || defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_COMPILER(NVRTC) || _CCCL_COMPILER(MSVC2017) template = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr span(type_identity_t (&__arr)[_Sz]) noexcept : __data_{__arr} @@ -376,7 +376,7 @@ public: _LIBCUDACXX_HIDE_FROM_ABI constexpr span(type_identity_t (&__arr)[_Extent]) noexcept : __data_{__arr} {} -# endif // !_CCCL_COMPILER(NVRTC) && !_CCCL_COMPILER_MSVC_2017 +# endif // !_CCCL_COMPILER(NVRTC) && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _OtherElementType) _CCCL_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) @@ -855,7 +855,7 @@ _CCCL_HOST_DEVICE span(const _Container&) -> span= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_BEGIN_NAMESPACE_RANGES template _CCCL_INLINE_VAR constexpr bool enable_borrowed_range> = true; @@ -863,6 +863,6 @@ _CCCL_INLINE_VAR constexpr bool enable_borrowed_range> = true template _CCCL_INLINE_VAR constexpr bool enable_view> = true; _LIBCUDACXX_END_NAMESPACE_RANGES -#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX_SPAN diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/variant b/libcudacxx/include/cuda/std/detail/libcxx/include/variant index c40abf1fd23..d71967a3c85 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/variant +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/variant @@ -293,7 +293,7 @@ _LIBCUDACXX_END_NAMESPACE_STD_NOVERSION #endif // !_CCCL_NO_EXCEPTIONS -#if _CCCL_STD_VER >= 2014 && !defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -2152,6 +2152,6 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr auto&& __unchecked_get(variant<_Types...>& _ _LIBCUDACXX_END_NAMESPACE_STD -#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017) #endif // _LIBCUDACXX_VARIANT diff --git a/libcudacxx/include/cuda/std/inplace_vector b/libcudacxx/include/cuda/std/inplace_vector index 73449b26188..5137fce4209 100644 --- a/libcudacxx/include/cuda/std/inplace_vector +++ b/libcudacxx/include/cuda/std/inplace_vector @@ -315,11 +315,11 @@ protected: iterator __curr = __dest; for (; __first != __last; ++__curr, (void) ++__first) { -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) ::new (_CUDA_VSTD::__voidify(*__curr)) _Tp(_CUDA_VRANGES::iter_move(__first)); # else // ^^^ C++17 ^^^ / vvv C++14 vvv ::new (_CUDA_VSTD::__voidify(*__curr)) _Tp(_CUDA_VSTD::move(*__first)); -# endif // _CCCL_STD_VER <= 2014 || _CCCL_COMPILER_MSVC_2017 +# endif // _CCCL_STD_VER <= 2014 || _CCCL_COMPILER(MSVC2017) } this->__size_ += static_cast<__size_type>(__curr - __dest); } @@ -332,11 +332,11 @@ protected: auto __guard = __make_exception_guard(_Rollback_change_size<__inplace_vector_storage>{this, __dest, __curr}); for (; __first != __last; ++__curr, (void) ++__first) { -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) ::new (_CUDA_VSTD::__voidify(*__curr)) _Tp(_CUDA_VRANGES::iter_move(__first)); # else // ^^^ C++17 ^^^ / vvv C++14 vvv ::new (_CUDA_VSTD::__voidify(*__curr)) _Tp(_CUDA_VSTD::move(*__first)); -# endif // _CCCL_STD_VER <= 2014 || _CCCL_COMPILER_MSVC_2017 +# endif // _CCCL_STD_VER <= 2014 || _CCCL_COMPILER(MSVC2017) } __guard.__complete(); this->__size_ += static_cast<__size_type>(__curr - __dest); @@ -590,22 +590,22 @@ protected: _LIBCUDACXX_HIDE_FROM_ABI constexpr void __uninitialized_copy(_Iter __first, _Iter __last, iterator __dest) noexcept { _CUDA_VSTD::copy(__first, __last, __dest); -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) __size_ += static_cast<__size_type>(_CUDA_VRANGES::distance(__first, __last)); # else // ^^^ C++17 ^^^ / vvv C++14 vvv __size_ += static_cast<__size_type>(_CUDA_VSTD::distance(__first, __last)); -# endif // _CCCL_STD_VER <= 2014 || _CCCL_COMPILER_MSVC_2017 +# endif // _CCCL_STD_VER <= 2014 || _CCCL_COMPILER(MSVC2017) } template _LIBCUDACXX_HIDE_FROM_ABI constexpr void __uninitialized_move(_Iter __first, _Iter __last, iterator __dest) noexcept { _CUDA_VSTD::copy(__first, __last, __dest); -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) __size_ += static_cast<__size_type>(_CUDA_VRANGES::distance(__first, __last)); # else // ^^^ C++17 ^^^ / vvv C++14 vvv __size_ += static_cast<__size_type>(_CUDA_VSTD::distance(__first, __last)); -# endif // _CCCL_STD_VER <= 2014 || _CCCL_COMPILER_MSVC_2017 +# endif // _CCCL_STD_VER <= 2014 || _CCCL_COMPILER(MSVC2017) } }; @@ -670,9 +670,9 @@ struct __inplace_vector_base<_Tp, 0, __inplace_vector_specialization::__empty> _LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp& unchecked_emplace_back(_Args&&...) noexcept { _CCCL_UNREACHABLE(); -# if defined(_CCCL_COMPILER_MSVC) +# if _CCCL_COMPILER(MSVC) return *begin(); -# endif // _CCCL_COMPILER_MSVC +# endif // _CCCL_COMPILER(MSVC) } protected: @@ -800,7 +800,7 @@ public: } } -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _Range) _CCCL_REQUIRES( _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) @@ -851,7 +851,7 @@ public: this->__uninitialized_move(_CUDA_VRANGES::begin(__range), _CUDA_VRANGES::__unwrap_end(__range), this->begin()); } } -# endif // _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector& operator=(initializer_list<_Tp> __ilist) { @@ -961,7 +961,7 @@ public: } } -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _Range) _CCCL_REQUIRES( _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) @@ -1037,7 +1037,7 @@ public: this->__uninitialized_copy(__middle, __last, this->end()); } } -# endif // _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) // [containers.sequences.inplace.vector.access], element access _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr reference at(const size_type __pos) @@ -1307,7 +1307,7 @@ public: return __res; } -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _Range) _CCCL_REQUIRES( _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) @@ -1355,7 +1355,7 @@ public: auto __first = _CUDA_VRANGES::begin(__range); insert(this->end(), __first, _CUDA_VRANGES::__unwrap_end(__range)); } -# endif // _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) template _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator emplace(const_iterator __cpos, _Args&&... __args) @@ -1451,7 +1451,7 @@ public: return _CUDA_VSTD::addressof(this->unchecked_emplace_back(_CUDA_VSTD::move(__value))); } -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _Range) _CCCL_REQUIRES( _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) @@ -1498,7 +1498,7 @@ public: this->__uninitialized_move(__first, __middle, this->end()); return __middle; } -# endif // _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) using __base::unchecked_emplace_back; @@ -1786,7 +1786,7 @@ public: } } -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _Range) _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(from_range_t, _Range&& __range) @@ -1797,7 +1797,7 @@ public: _CUDA_VSTD::__throw_bad_alloc(); } } -# endif // _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector& operator=(initializer_list<_Tp> __ilist) { @@ -1838,7 +1838,7 @@ public: return; } -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _Range) _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) @@ -1849,7 +1849,7 @@ public: } return; } -# endif // _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) // [containers.sequences.inplace.vector.access], element access _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr reference at(const size_type __pos) @@ -1996,7 +1996,7 @@ public: return nullptr; } -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _Range) _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __cpos, _Range&& __range) @@ -2017,7 +2017,7 @@ public: _CUDA_VSTD::__throw_bad_alloc(); } } -# endif // _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) template _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator emplace(const_iterator, _Args&&...) @@ -2061,14 +2061,14 @@ public: return nullptr; } -# if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) _CCCL_TEMPLATE(class _Range) _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _CUDA_VRANGES::iterator_t<_Range> try_append_range(_Range&& __range) noexcept { return _CUDA_VRANGES::begin(__range); } -# endif // _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) +# endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017) using __base::unchecked_emplace_back; diff --git a/libcudacxx/include/cuda/std/version b/libcudacxx/include/cuda/std/version index 841aa449c77..238259f45ef 100644 --- a/libcudacxx/include/cuda/std/version +++ b/libcudacxx/include/cuda/std/version @@ -48,9 +48,9 @@ # define __cccl_lib_is_null_pointer 201309L # define __cccl_lib_make_reverse_iterator 201402L // # define __cccl_lib_make_unique 201304L -# if !defined(_CCCL_COMPILER_MSVC) || _CCCL_STD_VER >= 2020 +# if !_CCCL_COMPILER(MSVC) || _CCCL_STD_VER >= 2020 # define __cccl_lib_mdspan 202207L -# endif // _CCCL_COMPILER_MSVC && _CCCL_STD_VER >= 2020 +# endif // _CCCL_COMPILER(MSVC) && _CCCL_STD_VER >= 2020 # define __cccl_lib_null_iterators 201304L # define __cccl_lib_optional 202110L // # define __cccl_lib_quoted_string_io 201304L diff --git a/libcudacxx/test/libcudacxx/std/language.support/support.srcloc/general.pass.cpp b/libcudacxx/test/libcudacxx/std/language.support/support.srcloc/general.pass.cpp index 976997b99b2..2fc33268dfc 100644 --- a/libcudacxx/test/libcudacxx/std/language.support/support.srcloc/general.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/language.support/support.srcloc/general.pass.cpp @@ -68,7 +68,7 @@ ASSERT_NOEXCEPT(device_empty.function_name()); constexpr cuda::std::source_location cur = cuda::std::source_location::current(); static_assert(cur.line() == 1000, ""); -#if _CCCL_HAS_BUILTIN(__builtin_COLUMN) || defined(TEST_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1927 +#if _CCCL_HAS_BUILTIN(__builtin_COLUMN) || defined(TEST_COMPILER_MSVC) && _MSC_VER >= 1927 static_assert(cur.column() > 0, ""); #else // ^^^ _CCCL_BULTIN_COLUMN ^^^ / vvv !_CCCL_BULTIN_COLUMN vvv static_assert(cur.column() == 0, ""); @@ -78,7 +78,7 @@ static_assert(cur.file_name()[0] == __FILE__[0] && cur.file_name()[1] == __FILE_ ""); // MSVC below 19.27 is broken with function name -#if !defined(_CCCL_COMPILER_MSVC) || _CCCL_MSVC_VERSION >= 1927 +#if !_CCCL_COMPILER(MSVC) || _MSC_VER >= 1927 static_assert(cur.function_name()[0] == '\0', ""); #else // ^^^ __builtin_FUNCTION ^^^ / vvv !__builtin_FUNCTION vvv static_assert(compare_strings(cur.function_name(), "__builtin_FUNCTION is unsupported")); @@ -139,14 +139,14 @@ __host__ __device__ void test() assert(compare_strings(local.file_name(), __FILE__)); // MSVC below 19.27 is broken with function name -#if !defined(_CCCL_COMPILER_MSVC) || _CCCL_MSVC_VERSION >= 1927 +#if !_CCCL_COMPILER(MSVC) || _MSC_VER >= 1927 assert(find_substring(local.function_name(), "test")); #else // ^^^ __builtin_FUNCTION ^^^ / vvv !__builtin_FUNCTION vvv assert(compare_strings(local.function_name(), "__builtin_FUNCTION is unsupported")); #endif // !__builtin_FUNCTION assert(local.line() == 2000); -#if _CCCL_HAS_BUILTIN(__builtin_COLUMN) || defined(TEST_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1927 +#if _CCCL_HAS_BUILTIN(__builtin_COLUMN) || defined(TEST_COMPILER_MSVC) && _MSC_VER >= 1927 assert(cur.column() > 0); #else // ^^^ _CCCL_BULTIN_COLUMN ^^^ / vvv !_CCCL_BULTIN_COLUMN vvv assert(cur.column() == 0); diff --git a/libcudacxx/test/libcudacxx/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp index db3e3877dc0..25a0d2aff05 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp @@ -67,7 +67,7 @@ __host__ __device__ TEST_CONSTEXPR_CXX14 bool test() int main(int, char**) { test(); -#if TEST_STD_VER >= 2014 && (_CCCL_CUDACC_AT_LEAST(11, 8) || !defined(_CCCL_COMPILER_MSVC)) +#if TEST_STD_VER >= 2014 && (_CCCL_CUDACC_AT_LEAST(11, 8) || !_CCCL_COMPILER(MSVC)) static_assert(test(), ""); #endif // TEST_STD_VER >= 2014 diff --git a/libcudacxx/test/libcudacxx/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp index 2c22b439ffb..61953443dfd 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp @@ -66,7 +66,7 @@ __host__ __device__ TEST_CONSTEXPR_CXX14 bool test() int main(int, char**) { test(); -#if TEST_STD_VER >= 2014 && (_CCCL_CUDACC_AT_LEAST(11, 8) || !defined(_CCCL_COMPILER_MSVC)) +#if TEST_STD_VER >= 2014 && (_CCCL_CUDACC_AT_LEAST(11, 8) || !_CCCL_COMPILER(MSVC)) static_assert(test(), ""); #endif // TEST_STD_VER >= 2014 diff --git a/libcudacxx/test/support/test_macros.h b/libcudacxx/test/support/test_macros.h index c42adf2d0bb..c81987a0dc1 100644 --- a/libcudacxx/test/support/test_macros.h +++ b/libcudacxx/test/support/test_macros.h @@ -148,7 +148,7 @@ #endif #if TEST_HAS_BUILTIN(__builtin_is_constant_evaluated) || _CCCL_COMPILER(GCC, >=, 9) \ - || (defined(_CCCL_COMPILER_MSVC) && _MSC_VER > 1924 && _CCCL_CUDACC_AT_LEAST(11, 3)) + || (_CCCL_COMPILER(MSVC) && _MSC_VER > 1924 && _CCCL_CUDACC_AT_LEAST(11, 3)) # define TEST_IS_CONSTANT_EVALUATED() _CUDA_VSTD::__libcpp_is_constant_evaluated() #else # define TEST_IS_CONSTANT_EVALUATED() false @@ -245,8 +245,8 @@ #endif #ifndef TEST_HAS_NO_EXCEPTIONS -# if (defined(_CCCL_COMPILER_MSVC) && _HAS_EXCEPTIONS == 0) \ - || (!defined(_CCCL_COMPILER_MSVC) && !__EXCEPTIONS) // Catches all non msvc based compilers +# if (_CCCL_COMPILER(MSVC) && _HAS_EXCEPTIONS == 0) || (!_CCCL_COMPILER(MSVC) && !__EXCEPTIONS) // Catches all non msvc + // based compilers # define TEST_HAS_NO_EXCEPTIONS # endif #endif // !TEST_HAS_NO_EXCEPTIONS diff --git a/thrust/testing/async_sort.cu b/thrust/testing/async_sort.cu index feb5cb5624a..77144779814 100644 --- a/thrust/testing/async_sort.cu +++ b/thrust/testing/async_sort.cu @@ -1,7 +1,7 @@ #include // Disabled on MSVC && NVCC < 11.1 for GH issue #1098. -#if defined(_CCCL_COMPILER_MSVC) && defined(__CUDACC__) +#if _CCCL_COMPILER(MSVC) && defined(__CUDACC__) # if (__CUDACC_VER_MAJOR__ < 11) || (__CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ < 1) # define THRUST_BUG_1098_ACTIVE # endif // NVCC version check diff --git a/thrust/testing/cuda/transform.cu b/thrust/testing/cuda/transform.cu index 888264ffce2..2e474ccfb5a 100644 --- a/thrust/testing/cuda/transform.cu +++ b/thrust/testing/cuda/transform.cu @@ -355,7 +355,7 @@ struct sum_five }; // The following test cannot be compiled because of a bug in the conversion of thrust::tuple on MSVC 2017 -#ifndef _CCCL_COMPILER_MSVC_2017 +#if !_CCCL_COMPILER(MSVC2017) // we specialize zip_function for sum_five, but do nothing in the call operator so the test below would fail if the // zip_function is actually called (and not unwrapped) THRUST_NAMESPACE_BEGIN @@ -420,4 +420,4 @@ void TestTransformZipIteratorUnwrapping() } } DECLARE_UNITTEST(TestTransformZipIteratorUnwrapping); -#endif // !_CCCL_COMPILER_MSVC_2017 +#endif // !_CCCL_COMPILER(MSVC2017) diff --git a/thrust/testing/functional.cu b/thrust/testing/functional.cu index 20478dbcb9b..7757ed47bed 100644 --- a/thrust/testing/functional.cu +++ b/thrust/testing/functional.cu @@ -212,7 +212,7 @@ THRUST_DISABLE_BROKEN_GCC_VECTORIZER void TestIdentityFunctional() // value categories when casting to different type static_assert(::cuda::std::is_same{}(3.14)), int&&>::value, ""); // unfortunately, old versions of MSVC pick the `const int&` overload instead of `int&&` -#if defined(_CCCL_COMPILER_MSVC) && _CCCL_MSVC_VERSION >= 1929 +#if _CCCL_COMPILER(MSVC, >=, 19, 29) static_assert(::cuda::std::is_same{}(d)), int&&>::value, ""); static_assert(::cuda::std::is_same{}(as_const(d))), int&&>::value, ""); #endif diff --git a/thrust/testing/set_difference.cu b/thrust/testing/set_difference.cu index cdb538d384c..5fe1de1fc1e 100644 --- a/thrust/testing/set_difference.cu +++ b/thrust/testing/set_difference.cu @@ -172,7 +172,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetDifferenceMultiset); // FIXME: disabled on Windows, because it causes a failure on the internal CI system in one specific configuration. // That failure will be tracked in a new NVBug, this is disabled to unblock submitting all the other changes. -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) void TestSetDifferenceWithBigIndexesHelper(int magnitude) { thrust::counting_iterator begin(0); diff --git a/thrust/testing/set_intersection.cu b/thrust/testing/set_intersection.cu index 392e23b7337..af95e2cdf07 100644 --- a/thrust/testing/set_intersection.cu +++ b/thrust/testing/set_intersection.cu @@ -206,7 +206,7 @@ DECLARE_VARIABLE_UNITTEST(TestSetIntersectionMultiset); // FIXME: disabled on Windows, because it causes a failure on the internal CI system in one specific configuration. // That failure will be tracked in a new NVBug, this is disabled to unblock submitting all the other changes. -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) void TestSetDifferenceWithBigIndexesHelper(int magnitude) { thrust::counting_iterator begin1(0); diff --git a/thrust/testing/vector_manipulation.cu b/thrust/testing/vector_manipulation.cu index e5492eeb1a0..3a10492319c 100644 --- a/thrust/testing/vector_manipulation.cu +++ b/thrust/testing/vector_manipulation.cu @@ -20,7 +20,7 @@ void TestVectorManipulation(size_t n) ASSERT_EQUAL(test1.size(), n); ASSERT_EQUAL((test1 == std::vector(n, T(3))), true); -#if defined(_CCCL_COMPILER_MSVC) && (_MSC_VER <= 1400) +#if _CCCL_COMPILER(MSVC, <=, 14) // XXX MSVC 2005's STL unintentionally uses adl to dispatch advance which // produces an ambiguity between std::advance & thrust::advance // don't produce a KNOWN_FAILURE, just ignore the issue diff --git a/thrust/thrust/detail/config/compiler.h b/thrust/thrust/detail/config/compiler.h index 6b73b04f55e..25d8ebfb29e 100644 --- a/thrust/thrust/detail/config/compiler.h +++ b/thrust/thrust/detail/config/compiler.h @@ -55,13 +55,13 @@ #define THRUST_DEVICE_COMPILER_NVCC 4 // figure out which host compiler we're using -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) //! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_MSVC //! deprecated [Since 2.7] -# define THRUST_MSVC_VERSION _CCCL_MSVC_VERSION +# define THRUST_MSVC_VERSION _MSC_VER //! deprecated [Since 2.7] -# define THRUST_MSVC_VERSION_FULL _CCCL_MSVC_VERSION_FULL +# define THRUST_MSVC_VERSION_FULL _MSC_FULL_VER #elif _CCCL_COMPILER(ICC) //! deprecated [Since 2.7] # define THRUST_HOST_COMPILER THRUST_HOST_COMPILER_INTEL @@ -91,7 +91,7 @@ #if defined(__CUDACC__) || defined(_NVHPC_CUDA) //! deprecated [Since 2.7] # define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_NVCC -#elif defined(_CCCL_COMPILER_MSVC) +#elif _CCCL_COMPILER(MSVC) //! deprecated [Since 2.7] # define THRUST_DEVICE_COMPILER THRUST_DEVICE_COMPILER_MSVC #elif _CCCL_COMPILER(GCC) diff --git a/thrust/thrust/detail/config/compiler_fence.h b/thrust/thrust/detail/config/compiler_fence.h index fc8cda95682..4b93b682c99 100644 --- a/thrust/thrust/detail/config/compiler_fence.h +++ b/thrust/thrust/detail/config/compiler_fence.h @@ -28,7 +28,7 @@ #include -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # pragma message( \ "warning: The functionality in this header is unsafe, deprecated, and will soon be removed. Use C++11 atomics instead.") #else @@ -36,7 +36,7 @@ #endif // msvc case -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # ifndef _DEBUG diff --git a/thrust/thrust/detail/config/cpp_dialect.h b/thrust/thrust/detail/config/cpp_dialect.h index e7589b39638..87733b15d55 100644 --- a/thrust/thrust/detail/config/cpp_dialect.h +++ b/thrust/thrust/detail/config/cpp_dialect.h @@ -68,7 +68,7 @@ #define THRUST_CPP_DIALECT _CCCL_STD_VER // Define THRUST_COMPILER_DEPRECATION macro: -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) # define THRUST_COMP_DEPR_IMPL(msg) _CCCL_PRAGMA(message(__FILE__ ":" _CCCL_TO_STRING(__LINE__) ": warning: " #msg)) #else // clang / gcc: # define THRUST_COMP_DEPR_IMPL(msg) _CCCL_PRAGMA(GCC warning #msg) @@ -89,10 +89,10 @@ THRUST_COMPILER_DEPRECATION(GCC 5.0); # elif _CCCL_COMPILER(CLANG, <, 7) THRUST_COMPILER_DEPRECATION(Clang 7.0); -# elif defined(_CCCL_COMPILER_MSVC) && THRUST_MSVC_VERSION < 1910 +# elif _CCCL_COMPILER(MSVC, <, 19, 10) // <2017. Hard upgrade message: THRUST_COMPILER_DEPRECATION(MSVC 2019(19.20 / 16.0 / 14.20)); -# elif defined(_CCCL_COMPILER_MSVC) && THRUST_MSVC_VERSION < 1920 +# elif _CCCL_COMPILER(MSVC2017) // >=2017, <2019. Soft deprecation message: THRUST_COMPILER_DEPRECATION_SOFT(MSVC 2019(19.20 / 16.0 / 14.20), MSVC 2017); # endif diff --git a/thrust/thrust/detail/config/deprecated.h b/thrust/thrust/detail/config/deprecated.h index af53047212d..29204f49287 100644 --- a/thrust/thrust/detail/config/deprecated.h +++ b/thrust/thrust/detail/config/deprecated.h @@ -43,7 +43,7 @@ #elif _CCCL_STD_VER >= 2014 # define THRUST_DEPRECATED [[deprecated]] # define THRUST_DEPRECATED_BECAUSE(MSG) [[deprecated(MSG)]] -#elif defined(_CCCL_COMPILER_MSVC) +#elif _CCCL_COMPILER(MSVC) # define THRUST_DEPRECATED __declspec(deprecated) # define THRUST_DEPRECATED_BECAUSE(MSG) __declspec(deprecated(MSG)) #elif _CCCL_COMPILER(CLANG) diff --git a/thrust/thrust/iterator/permutation_iterator.h b/thrust/thrust/iterator/permutation_iterator.h index 821a0a2484d..38dd35456b8 100644 --- a/thrust/thrust/iterator/permutation_iterator.h +++ b/thrust/thrust/iterator/permutation_iterator.h @@ -170,10 +170,10 @@ class permutation_iterator : public thrust::detail::permutation_iterator_basebase()); } -#if defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_COMPILER(MSVC2017) _CCCL_DIAG_POP -#endif // _CCCL_COMPILER_MSVC_2017 +#endif // _CCCL_COMPILER(MSVC2017) // make friends for the copy constructor template diff --git a/thrust/thrust/iterator/reverse_iterator.h b/thrust/thrust/iterator/reverse_iterator.h index 21d258e6d31..a3e6b737b68 100644 --- a/thrust/thrust/iterator/reverse_iterator.h +++ b/thrust/thrust/iterator/reverse_iterator.h @@ -163,11 +163,11 @@ class reverse_iterator : public detail::reverse_iterator_base::type /*! Default constructor does nothing. */ -#if defined(_CCCL_COMPILER_MSVC_2017) +#if _CCCL_COMPILER(MSVC2017) inline _CCCL_HOST_DEVICE zip_iterator() {} -#else // ^^^ _CCCL_COMPILER_MSVC_2017 ^^^ / vvv !_CCCL_COMPILER_MSVC_2017 vvv +#else // ^^^ _CCCL_COMPILER(MSVC2017) ^^^ / vvv !_CCCL_COMPILER(MSVC2017) vvv zip_iterator() = default; -#endif // !_CCCL_COMPILER_MSVC_2017 +#endif // !_CCCL_COMPILER(MSVC2017) /*! This constructor creates a new \p zip_iterator from a * \p tuple of iterators. diff --git a/thrust/thrust/optional.h b/thrust/thrust/optional.h index bb9bf1cfb4b..dbee5ebda24 100644 --- a/thrust/thrust/optional.h +++ b/thrust/thrust/optional.h @@ -37,7 +37,7 @@ #include #include -#if defined(_CCCL_COMPILER_MSVC) && _MSC_VER == 1900 +#if _CCCL_COMPILER(MSVC, ==, 19, 00) # define THRUST_OPTIONAL_MSVC2015 #endif @@ -231,7 +231,7 @@ using enable_assign_from_other = detail::enable_if_t< && !std::is_assignable&>::value && !std::is_assignable&&>::value && !std::is_assignable&>::value && !std::is_assignable&&>::value>; -#if defined(_CCCL_COMPILER_MSVC) +#if _CCCL_COMPILER(MSVC) // TODO make a version which works with MSVC template struct is_swappable : std::true_type diff --git a/thrust/thrust/system/detail/error_code.inl b/thrust/thrust/system/detail/error_code.inl index e27c7db0286..0f41a9da220 100644 --- a/thrust/thrust/system/detail/error_code.inl +++ b/thrust/thrust/system/detail/error_code.inl @@ -50,10 +50,10 @@ error_code ::error_code(int val, const error_category& cat) template error_code ::error_code(ErrorCodeEnum e // XXX WAR msvc's problem with enable_if -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) , ::cuda::std::enable_if_t::value>* -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) ) { *this = make_error_code(e); @@ -67,11 +67,11 @@ void error_code ::assign(int val, const error_category& cat) template // XXX WAR msvc's problem with enable_if -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) ::cuda::std::enable_if_t::value, error_code>& #else error_code& -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) error_code ::operator=(ErrorCodeEnum e) { *this = make_error_code(e); diff --git a/thrust/thrust/system/detail/error_condition.inl b/thrust/thrust/system/detail/error_condition.inl index a63323be760..f9ad1f2b696 100644 --- a/thrust/thrust/system/detail/error_condition.inl +++ b/thrust/thrust/system/detail/error_condition.inl @@ -51,10 +51,10 @@ error_condition ::error_condition(int val, const error_category& cat) template error_condition ::error_condition(ErrorConditionEnum e // XXX WAR msvc's problem with enable_if -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) , ::cuda::std::enable_if_t::value>* -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) ) { *this = make_error_condition(e); @@ -68,11 +68,11 @@ void error_condition ::assign(int val, const error_category& cat) template // XXX WAR msvc's problem with enable_if -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) ::cuda::std::enable_if_t::value, error_condition>& #else error_condition& -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) error_condition ::operator=(ErrorConditionEnum e) { *this = make_error_condition(e); diff --git a/thrust/thrust/system/error_code.h b/thrust/thrust/system/error_code.h index d5313db8b2b..1573f8a3a82 100644 --- a/thrust/thrust/system/error_code.h +++ b/thrust/thrust/system/error_code.h @@ -256,10 +256,10 @@ class error_code template error_code(ErrorCodeEnum e // XXX WAR msvc's problem with enable_if -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) , ::cuda::std::enable_if_t::value>* = 0 -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) ); // [19.5.2.3] modifiers: @@ -272,11 +272,11 @@ class error_code */ template // XXX WAR msvc's problem with enable_if -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) ::cuda::std::enable_if_t::value, error_code>& #else error_code& -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) operator=(ErrorCodeEnum e); /*! \post value() == 0 and category() == system_category(). @@ -367,10 +367,10 @@ class error_condition template error_condition(ErrorConditionEnum e // XXX WAR msvc's problem with enable_if -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) , ::cuda::std::enable_if_t::value>* = 0 -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) ); // [19.5.3.3] modifiers @@ -391,11 +391,11 @@ class error_condition */ template // XXX WAR msvc's problem with enable_if -#if !defined(_CCCL_COMPILER_MSVC) +#if !_CCCL_COMPILER(MSVC) ::cuda::std::enable_if_t::value, error_condition>& #else error_condition& -#endif // !_CCCL_COMPILER_MSVC +#endif // !_CCCL_COMPILER(MSVC) operator=(ErrorConditionEnum e); /*! Clears this \p error_code object. diff --git a/thrust/thrust/type_traits/is_contiguous_iterator.h b/thrust/thrust/type_traits/is_contiguous_iterator.h index 26ef2020e6b..303b54f38a4 100644 --- a/thrust/thrust/type_traits/is_contiguous_iterator.h +++ b/thrust/thrust/type_traits/is_contiguous_iterator.h @@ -39,7 +39,7 @@ #include #include -#if defined(_CCCL_COMPILER_MSVC) && _MSC_VER < 1916 // MSVC 2017 version 15.9 +#if _CCCL_COMPILER(MSVC, <, 19, 16) // MSVC 2017 version 15.9 # include # include # include