diff --git a/thrust/cmake/DetectSupportedStandards.cmake b/thrust/cmake/DetectSupportedStandards.cmake index c40e1c0ea0a..5bc17260f51 100644 --- a/thrust/cmake/DetectSupportedStandards.cmake +++ b/thrust/cmake/DetectSupportedStandards.cmake @@ -8,11 +8,10 @@ # - lang: The language to test: C, CXX, or CUDA. # - standards: List of any standard versions. # -# Example: detect_supported_cxx_standards(PROJ CXX 11 14 17) +# Example: detect_supported_cxx_standards(PROJ CXX 17 20) # - Sets the following variables in the parent scope to TRUE or FALSE: -# - PROJ_CXX_11_SUPPORTED -# - PROJ_CXX_14_SUPPORTED # - PROJ_CXX_17_SUPPORTED +# - PROJ_CXX_20_SUPPORTED # function(detect_supported_standards prefix lang) string(TOLOWER "${lang}_std" feature_prefix) diff --git a/thrust/cmake/ThrustBuildTargetList.cmake b/thrust/cmake/ThrustBuildTargetList.cmake index 0780690d21f..6fc6637722d 100644 --- a/thrust/cmake/ThrustBuildTargetList.cmake +++ b/thrust/cmake/ThrustBuildTargetList.cmake @@ -181,17 +181,6 @@ function(_thrust_build_target_list_multiconfig) endif() endif() - # Supported versions of MSVC do not distinguish between C++11 and C++14. - # Warn the user that they may be generating a ton of redundant targets if - # they explicitly requested this configuration. - if ("MSVC" STREQUAL "${CMAKE_CXX_COMPILER_ID}" AND - THRUST_MULTICONFIG_ENABLE_DIALECT_CPP11) - message(WARNING - "Supported versions of MSVC (2017+) do not distinguish between C++11 " - "and C++14. The requested C++11 targets may be redundant." - ) - endif() - # Build THRUST_TARGETS foreach(host IN LISTS THRUST_HOST_SYSTEM_OPTIONS) foreach(device IN LISTS THRUST_DEVICE_SYSTEM_OPTIONS) diff --git a/thrust/testing/async/exclusive_scan/counting_iterator.cu b/thrust/testing/async/exclusive_scan/counting_iterator.cu index 4d19e7c1978..13de9db2599 100644 --- a/thrust/testing/async/exclusive_scan/counting_iterator.cu +++ b/thrust/testing/async/exclusive_scan/counting_iterator.cu @@ -4,13 +4,11 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 +#include +#include -# include -# include - -# include -# include +#include +#include template -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include // Compilation test with discard iterators. No runtime validation is actually // performed, other than testing whether the algorithm completes without @@ -40,6 +38,4 @@ struct test_discard }; DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_discard, NumericTypes); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/exclusive_scan/large_indices.cu b/thrust/testing/async/exclusive_scan/large_indices.cu index 2c86bed9ca0..f2ab7fe1dd0 100644 --- a/thrust/testing/async/exclusive_scan/large_indices.cu +++ b/thrust/testing/async/exclusive_scan/large_indices.cu @@ -4,19 +4,17 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include +#include +#include -# include -# include -# include -# include -# include -# include +#include -# include - -# include -# include +#include +#include // This test is an adaptation of TestInclusiveScanWithBigIndices from scan.cu. @@ -240,6 +238,4 @@ void test_large_indices_custom_scan_op() } DECLARE_UNITTEST(test_large_indices_custom_scan_op); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/exclusive_scan/large_types.cu b/thrust/testing/async/exclusive_scan/large_types.cu index fef9511752f..c7ac3d423cb 100644 --- a/thrust/testing/async/exclusive_scan/large_types.cu +++ b/thrust/testing/async/exclusive_scan/large_types.cu @@ -4,11 +4,9 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 - -# include -# include -# include +#include +#include +#include // This test is an adaptation of TestScanWithLargeTypes from scan.cu. @@ -55,6 +53,4 @@ struct test_large_types }; DECLARE_UNITTEST(test_large_types); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/exclusive_scan/mixed_types.cu b/thrust/testing/async/exclusive_scan/mixed_types.cu index 4c12f07ae35..de7c9a0dbf1 100644 --- a/thrust/testing/async/exclusive_scan/mixed_types.cu +++ b/thrust/testing/async/exclusive_scan/mixed_types.cu @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include // Test using mixed int/float types for: // - input_value_type | (int, float) @@ -118,6 +116,4 @@ void test_scan_mixed_types(size_t num_values) } DECLARE_SIZED_UNITTEST(test_scan_mixed_types); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/exclusive_scan/mixin.h b/thrust/testing/async/exclusive_scan/mixin.h index 2ba787c6c8e..68f7f266ff0 100644 --- a/thrust/testing/async/exclusive_scan/mixin.h +++ b/thrust/testing/async/exclusive_scan/mixin.h @@ -2,12 +2,10 @@ #include -#if _CCCL_STD_VER >= 2014 +#include +#include -# include -# include - -# include +#include namespace testing { @@ -111,5 +109,3 @@ struct simple } // namespace exclusive_scan } // namespace async } // namespace testing - -#endif // C++14 diff --git a/thrust/testing/async/exclusive_scan/simple.cu b/thrust/testing/async/exclusive_scan/simple.cu index 0c954d8cb44..47a7cd25768 100644 --- a/thrust/testing/async/exclusive_scan/simple.cu +++ b/thrust/testing/async/exclusive_scan/simple.cu @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include template -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include namespace { @@ -65,6 +63,4 @@ struct test_stateful_operator }; DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_stateful_operator, NumericTypes); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/exclusive_scan/using_vs_adl.cu b/thrust/testing/async/exclusive_scan/using_vs_adl.cu index 27e9a3f4d86..6bfd23578fb 100644 --- a/thrust/testing/async/exclusive_scan/using_vs_adl.cu +++ b/thrust/testing/async/exclusive_scan/using_vs_adl.cu @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include // Verify what happens when calling the algorithm without any namespace // qualifiers: @@ -171,6 +169,4 @@ void test_using_cpo() } DECLARE_UNITTEST(test_using_cpo); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/inclusive_scan/counting_iterator.cu b/thrust/testing/async/inclusive_scan/counting_iterator.cu index ba4cdb7778e..288671d8f7e 100644 --- a/thrust/testing/async/inclusive_scan/counting_iterator.cu +++ b/thrust/testing/async/inclusive_scan/counting_iterator.cu @@ -4,13 +4,11 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 +#include +#include -# include -# include - -# include -# include +#include +#include template -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include // Compilation test with discard iterators. No runtime validation is actually // performed, other than testing whether the algorithm completes without @@ -38,6 +36,4 @@ struct test_discard }; DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_discard, NumericTypes); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/inclusive_scan/large_indices.cu b/thrust/testing/async/inclusive_scan/large_indices.cu index c37c63a7902..78d3b901ba9 100644 --- a/thrust/testing/async/inclusive_scan/large_indices.cu +++ b/thrust/testing/async/inclusive_scan/large_indices.cu @@ -4,19 +4,17 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include +#include +#include -# include -# include -# include -# include -# include -# include +#include -# include - -# include -# include +#include +#include // This test is an adaptation of TestInclusiveScanWithBigIndices from scan.cu. @@ -235,6 +233,4 @@ void test_large_indices_custom_scan_op() } DECLARE_UNITTEST(test_large_indices_custom_scan_op); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/inclusive_scan/large_types.cu b/thrust/testing/async/inclusive_scan/large_types.cu index 8e84d4c76ef..c2b8bce5d5a 100644 --- a/thrust/testing/async/inclusive_scan/large_types.cu +++ b/thrust/testing/async/inclusive_scan/large_types.cu @@ -4,11 +4,9 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 - -# include -# include -# include +#include +#include +#include // This test is an adaptation of TestScanWithLargeTypes from scan.cu. @@ -55,6 +53,4 @@ struct test_large_types }; DECLARE_UNITTEST(test_large_types); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/inclusive_scan/mixed_types.cu b/thrust/testing/async/inclusive_scan/mixed_types.cu index 1c94c13acf9..87b3c321b2b 100644 --- a/thrust/testing/async/inclusive_scan/mixed_types.cu +++ b/thrust/testing/async/inclusive_scan/mixed_types.cu @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include // Test using mixed int/float types for: // - input_value_type | (int, float) @@ -109,6 +107,4 @@ void test_scan_mixed_types(size_t num_values) } DECLARE_SIZED_UNITTEST(test_scan_mixed_types); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/inclusive_scan/mixin.h b/thrust/testing/async/inclusive_scan/mixin.h index 453b5583681..076df51f479 100644 --- a/thrust/testing/async/inclusive_scan/mixin.h +++ b/thrust/testing/async/inclusive_scan/mixin.h @@ -2,12 +2,10 @@ #include -#if _CCCL_STD_VER >= 2014 +#include +#include -# include -# include - -# include +#include namespace testing { @@ -127,5 +125,3 @@ struct simple } // namespace inclusive_scan } // namespace async } // namespace testing - -#endif // C++14 diff --git a/thrust/testing/async/inclusive_scan/simple.cu b/thrust/testing/async/inclusive_scan/simple.cu index 18bc0e48e7a..5e9ccce7b4a 100644 --- a/thrust/testing/async/inclusive_scan/simple.cu +++ b/thrust/testing/async/inclusive_scan/simple.cu @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include template -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include namespace { @@ -65,6 +63,4 @@ struct test_stateful_operator }; DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_stateful_operator, NumericTypes); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/inclusive_scan/using_vs_adl.cu b/thrust/testing/async/inclusive_scan/using_vs_adl.cu index 846cdee108d..040002234a9 100644 --- a/thrust/testing/async/inclusive_scan/using_vs_adl.cu +++ b/thrust/testing/async/inclusive_scan/using_vs_adl.cu @@ -4,10 +4,8 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include // Verify what happens when calling the algorithm without any namespace // qualifiers: @@ -169,6 +167,4 @@ void test_using_cpo() } DECLARE_UNITTEST(test_using_cpo); -#endif // C++14 - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async/mixin.h b/thrust/testing/async/mixin.h index 825502f2477..ed5f8514ebe 100644 --- a/thrust/testing/async/mixin.h +++ b/thrust/testing/async/mixin.h @@ -2,21 +2,19 @@ #include -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include +#include +#include +#include -# include -# include -# include -# include -# include -# include -# include +#include +#include -# include -# include - -# include -# include +#include +#include // clang-format off @@ -678,5 +676,3 @@ struct noop } // namespace mixin } // namespace async } // namespace testing - -#endif // C++14 diff --git a/thrust/testing/async/test_policy_overloads.h b/thrust/testing/async/test_policy_overloads.h index 60278e1ce2e..6da44b2b5af 100644 --- a/thrust/testing/async/test_policy_overloads.h +++ b/thrust/testing/async/test_policy_overloads.h @@ -2,14 +2,12 @@ #include -#if _CCCL_STD_VER >= 2014 +#include +#include -# include -# include +#include -# include - -# include +#include // TODO Cover these cases from testing/async_reduce.cu: // - [x] test_async_reduce_after ("after_future" in test_policy_overloads) @@ -349,5 +347,3 @@ struct test_policy_overloads } // namespace async } // namespace testing - -#endif // C++14 diff --git a/thrust/testing/async_copy.cu b/thrust/testing/async_copy.cu index fccc9e2725c..75b39148838 100644 --- a/thrust/testing/async_copy.cu +++ b/thrust/testing/async_copy.cu @@ -5,27 +5,25 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 - -# include -# include -# include -# include - -# include -# include - -# define DEFINE_ASYNC_COPY_CALLABLE(name, ...) \ - struct THRUST_PP_CAT2(name, _fn) \ - { \ - template \ - _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& output) const \ - THRUST_RETURNS(::thrust::async::copy( \ - __VA_ARGS__ THRUST_PP_COMMA_IF(THRUST_PP_ARITY(__VA_ARGS__)) THRUST_FWD(first), \ - THRUST_FWD(last), \ - THRUST_FWD(output))) \ - }; \ - /**/ +#include +#include +#include +#include + +#include +#include + +#define DEFINE_ASYNC_COPY_CALLABLE(name, ...) \ + struct THRUST_PP_CAT2(name, _fn) \ + { \ + template \ + _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& output) const \ + THRUST_RETURNS(::thrust::async::copy( \ + __VA_ARGS__ THRUST_PP_COMMA_IF(THRUST_PP_ARITY(__VA_ARGS__)) THRUST_FWD(first), \ + THRUST_FWD(last), \ + THRUST_FWD(output))) \ + }; \ + /**/ DEFINE_ASYNC_COPY_CALLABLE(invoke_async_copy); @@ -37,7 +35,7 @@ DEFINE_ASYNC_COPY_CALLABLE(invoke_async_copy_device_to_host, thrust::device, thr DEFINE_ASYNC_COPY_CALLABLE(invoke_async_copy_host_to_host, thrust::host, thrust::host); DEFINE_ASYNC_COPY_CALLABLE(invoke_async_copy_device_to_device, thrust::device, thrust::device); -# undef DEFINE_ASYNC_COPY_CALLABLE +#undef DEFINE_ASYNC_COPY_CALLABLE /////////////////////////////////////////////////////////////////////////////// @@ -318,6 +316,4 @@ DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_async_copy_after, BuiltinNumericT // TODO: H->D copy, then dependent D->H copy (round trip). // Can't do this today because we can't do cross-system with explicit policies. -#endif - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async_for_each.cu b/thrust/testing/async_for_each.cu index f939fe85c7e..94b578c0eb6 100644 --- a/thrust/testing/async_for_each.cu +++ b/thrust/testing/async_for_each.cu @@ -1,31 +1,29 @@ #include -#if _CCCL_STD_VER >= 2014 +#include +#include +#include -# include -# include -# include - -# include +#include _CCCL_SUPPRESS_DEPRECATED_PUSH -# define DEFINE_ASYNC_FOR_EACH_CALLABLE(name, ...) \ - struct THRUST_PP_CAT2(name, _fn) \ - { \ - template \ - _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, UnaryFunction&& f) const \ - THRUST_RETURNS(::thrust::async::for_each( \ - __VA_ARGS__ THRUST_PP_COMMA_IF(THRUST_PP_ARITY(__VA_ARGS__)) THRUST_FWD(first), \ - THRUST_FWD(last), \ - THRUST_FWD(f))) \ - }; \ - /**/ +#define DEFINE_ASYNC_FOR_EACH_CALLABLE(name, ...) \ + struct THRUST_PP_CAT2(name, _fn) \ + { \ + template \ + _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, UnaryFunction&& f) const \ + THRUST_RETURNS(::thrust::async::for_each( \ + __VA_ARGS__ THRUST_PP_COMMA_IF(THRUST_PP_ARITY(__VA_ARGS__)) THRUST_FWD(first), \ + THRUST_FWD(last), \ + THRUST_FWD(f))) \ + }; \ + /**/ DEFINE_ASYNC_FOR_EACH_CALLABLE(invoke_async_for_each); DEFINE_ASYNC_FOR_EACH_CALLABLE(invoke_async_for_each_device, thrust::device); -# undef DEFINE_ASYNC_FOR_EACH_CALLABLE +#undef DEFINE_ASYNC_FOR_EACH_CALLABLE /////////////////////////////////////////////////////////////////////////////// @@ -69,5 +67,3 @@ DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES_AND_NAME( THRUST_PP_EXPAND_ARGS(test_async_for_each::tester), NumericTypes, test_async_for_each_policy); - -#endif diff --git a/thrust/testing/async_reduce.cu b/thrust/testing/async_reduce.cu index 82a347262b4..8dc91128e44 100644 --- a/thrust/testing/async_reduce.cu +++ b/thrust/testing/async_reduce.cu @@ -7,15 +7,13 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH #include -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include -# include -# include -# include -# include - -# include -# include +#include +#include template struct custom_plus @@ -26,48 +24,48 @@ struct custom_plus } }; -# define DEFINE_STATEFUL_ASYNC_REDUCE_INVOKER(NAME, MEMBERS, CTOR, DTOR, VALIDATE, ...) \ - template \ - struct NAME \ - { \ - MEMBERS \ - \ - NAME() \ - { \ - CTOR \ - } \ - \ - ~NAME() \ - { \ - DTOR \ - } \ - \ - template \ - void validate_event(Event& e) \ - { \ - THRUST_UNUSED_VAR(e); \ - VALIDATE \ - } \ - \ - template \ - _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last) \ - THRUST_DECLTYPE_RETURNS(::thrust::async::reduce(__VA_ARGS__)) \ - }; \ - /**/ - -# define DEFINE_ASYNC_REDUCE_INVOKER(NAME, ...) \ - DEFINE_STATEFUL_ASYNC_REDUCE_INVOKER( \ - NAME, THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), __VA_ARGS__) \ - /**/ - -# define DEFINE_SYNC_REDUCE_INVOKER(NAME, ...) \ - template \ - struct NAME \ - { \ - template \ - _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last) THRUST_RETURNS(::thrust::reduce(__VA_ARGS__)) \ - }; \ - /**/ +#define DEFINE_STATEFUL_ASYNC_REDUCE_INVOKER(NAME, MEMBERS, CTOR, DTOR, VALIDATE, ...) \ + template \ + struct NAME \ + { \ + MEMBERS \ + \ + NAME() \ + { \ + CTOR \ + } \ + \ + ~NAME() \ + { \ + DTOR \ + } \ + \ + template \ + void validate_event(Event& e) \ + { \ + THRUST_UNUSED_VAR(e); \ + VALIDATE \ + } \ + \ + template \ + _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last) \ + THRUST_DECLTYPE_RETURNS(::thrust::async::reduce(__VA_ARGS__)) \ + }; \ + /**/ + +#define DEFINE_ASYNC_REDUCE_INVOKER(NAME, ...) \ + DEFINE_STATEFUL_ASYNC_REDUCE_INVOKER( \ + NAME, THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), __VA_ARGS__) \ + /**/ + +#define DEFINE_SYNC_REDUCE_INVOKER(NAME, ...) \ + template \ + struct NAME \ + { \ + template \ + _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last) THRUST_RETURNS(::thrust::reduce(__VA_ARGS__)) \ + }; \ + /**/ DEFINE_ASYNC_REDUCE_INVOKER(reduce_async_invoker, THRUST_FWD(first), THRUST_FWD(last)); DEFINE_ASYNC_REDUCE_INVOKER(reduce_async_invoker_device, thrust::device, THRUST_FWD(first), THRUST_FWD(last)); @@ -701,7 +699,7 @@ struct test_async_reduce_allocator_on_then_after // FIXME: The below fails because you can't combine allocator attachment, // `.on`, and `.after`. // The `#if 0` can be removed once the KNOWN_FAILURE is resolved. -# if 0 +#if 0 ASSERT_EQUAL_QUIET(stream1, f2.stream().native_handle()); // This potentially runs concurrently with the copies. @@ -713,7 +711,7 @@ struct test_async_reduce_allocator_on_then_after thrust::cuda_cub::throw_on_error(cudaStreamDestroy(stream0)); thrust::cuda_cub::throw_on_error(cudaStreamDestroy(stream1)); -# endif +#endif } }; DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_async_reduce_allocator_on_then_after, NumericTypes); @@ -882,6 +880,4 @@ struct test_async_reduce_bug1886 }; DECLARE_UNITTEST(test_async_reduce_bug1886); -#endif - _CCCL_SUPPRESS_DEPRECATED_POP diff --git a/thrust/testing/async_reduce_into.cu b/thrust/testing/async_reduce_into.cu index 3cde0e68f6d..47ded380a5e 100644 --- a/thrust/testing/async_reduce_into.cu +++ b/thrust/testing/async_reduce_into.cu @@ -2,16 +2,14 @@ #include -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include +#include -# include -# include -# include -# include -# include - -# include -# include +#include +#include _CCCL_SUPPRESS_DEPRECATED_PUSH @@ -24,48 +22,48 @@ struct custom_plus } }; -# define DEFINE_STATEFUL_ASYNC_REDUCE_INTO_INVOKER(NAME, MEMBERS, CTOR, DTOR, VALIDATE, ...) \ - template \ - struct NAME \ - { \ - MEMBERS \ - \ - NAME() \ - { \ - CTOR \ - } \ - \ - ~NAME() \ - { \ - DTOR \ - } \ - \ - template \ - void validate_event(Event& e) \ - { \ - THRUST_UNUSED_VAR(e); \ - VALIDATE \ - } \ - \ - template \ - _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& output) \ - THRUST_DECLTYPE_RETURNS(::thrust::async::reduce_into(__VA_ARGS__)) \ - }; \ - /**/ +#define DEFINE_STATEFUL_ASYNC_REDUCE_INTO_INVOKER(NAME, MEMBERS, CTOR, DTOR, VALIDATE, ...) \ + template \ + struct NAME \ + { \ + MEMBERS \ + \ + NAME() \ + { \ + CTOR \ + } \ + \ + ~NAME() \ + { \ + DTOR \ + } \ + \ + template \ + void validate_event(Event& e) \ + { \ + THRUST_UNUSED_VAR(e); \ + VALIDATE \ + } \ + \ + template \ + _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& output) \ + THRUST_DECLTYPE_RETURNS(::thrust::async::reduce_into(__VA_ARGS__)) \ + }; \ + /**/ -# define DEFINE_ASYNC_REDUCE_INTO_INVOKER(NAME, ...) \ - DEFINE_STATEFUL_ASYNC_REDUCE_INTO_INVOKER( \ - NAME, THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), __VA_ARGS__) \ - /**/ +#define DEFINE_ASYNC_REDUCE_INTO_INVOKER(NAME, ...) \ + DEFINE_STATEFUL_ASYNC_REDUCE_INTO_INVOKER( \ + NAME, THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), __VA_ARGS__) \ + /**/ -# define DEFINE_SYNC_REDUCE_INVOKER(NAME, ...) \ - template \ - struct NAME \ - { \ - template \ - _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last) THRUST_RETURNS(::thrust::reduce(__VA_ARGS__)) \ - }; \ - /**/ +#define DEFINE_SYNC_REDUCE_INVOKER(NAME, ...) \ + template \ + struct NAME \ + { \ + template \ + _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last) THRUST_RETURNS(::thrust::reduce(__VA_ARGS__)) \ + }; \ + /**/ DEFINE_ASYNC_REDUCE_INTO_INVOKER(reduce_into_async_invoker, THRUST_FWD(first), THRUST_FWD(last), THRUST_FWD(output)); DEFINE_ASYNC_REDUCE_INTO_INVOKER( @@ -481,5 +479,3 @@ DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES_AND_NAME( reduce_sync_invoker_init_custom_plus>::tester), NumericTypes, test_async_reduce_into_policy_allocator_on_init_custom_plus); - -#endif diff --git a/thrust/testing/async_sort.cu b/thrust/testing/async_sort.cu index a074a27e140..a1bf0006804 100644 --- a/thrust/testing/async_sort.cu +++ b/thrust/testing/async_sort.cu @@ -12,7 +12,7 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH # endif // NVCC version check #endif // MSVC + NVCC check -#if _CCCL_STD_VER >= 2014 && !defined(THRUST_BUG_1098_ACTIVE) +#if !defined(THRUST_BUG_1098_ACTIVE) # include # include diff --git a/thrust/testing/async_transform.cu b/thrust/testing/async_transform.cu index 70821ec9dfa..f69e485d11d 100644 --- a/thrust/testing/async_transform.cu +++ b/thrust/testing/async_transform.cu @@ -1,14 +1,12 @@ #include -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include -# include -# include -# include -# include - -# include -# include +#include +#include _CCCL_SUPPRESS_DEPRECATED_PUSH @@ -21,49 +19,49 @@ struct divide_by_2 } }; -# define DEFINE_STATEFUL_ASYNC_TRANSFORM_UNARY_INVOKER(NAME, MEMBERS, CTOR, DTOR, VALIDATE, ...) \ - template \ - struct NAME \ - { \ - MEMBERS \ - \ - NAME() \ - { \ - CTOR \ - } \ - \ - ~NAME() \ - { \ - DTOR \ - } \ - \ - template \ - void validate_event(Event& e) \ - { \ - THRUST_UNUSED_VAR(e); \ - VALIDATE \ - } \ - \ - template \ - _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& output, UnaryOperation&& op) \ - THRUST_DECLTYPE_RETURNS(::thrust::async::transform(__VA_ARGS__)) \ - }; \ - /**/ - -# define DEFINE_ASYNC_TRANSFORM_UNARY_INVOKER(NAME, ...) \ - DEFINE_STATEFUL_ASYNC_TRANSFORM_UNARY_INVOKER( \ - NAME, THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), __VA_ARGS__) \ - /**/ - -# define DEFINE_SYNC_TRANSFORM_UNARY_INVOKER(NAME, ...) \ - template \ - struct NAME \ - { \ - template \ - _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& output, UnaryOperation&& op) \ - THRUST_RETURNS(::thrust::transform(__VA_ARGS__)) \ - }; \ - /**/ +#define DEFINE_STATEFUL_ASYNC_TRANSFORM_UNARY_INVOKER(NAME, MEMBERS, CTOR, DTOR, VALIDATE, ...) \ + template \ + struct NAME \ + { \ + MEMBERS \ + \ + NAME() \ + { \ + CTOR \ + } \ + \ + ~NAME() \ + { \ + DTOR \ + } \ + \ + template \ + void validate_event(Event& e) \ + { \ + THRUST_UNUSED_VAR(e); \ + VALIDATE \ + } \ + \ + template \ + _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& output, UnaryOperation&& op) \ + THRUST_DECLTYPE_RETURNS(::thrust::async::transform(__VA_ARGS__)) \ + }; \ + /**/ + +#define DEFINE_ASYNC_TRANSFORM_UNARY_INVOKER(NAME, ...) \ + DEFINE_STATEFUL_ASYNC_TRANSFORM_UNARY_INVOKER( \ + NAME, THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), THRUST_PP_EMPTY(), __VA_ARGS__) \ + /**/ + +#define DEFINE_SYNC_TRANSFORM_UNARY_INVOKER(NAME, ...) \ + template \ + struct NAME \ + { \ + template \ + _CCCL_HOST auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& output, UnaryOperation&& op) \ + THRUST_RETURNS(::thrust::transform(__VA_ARGS__)) \ + }; \ + /**/ DEFINE_ASYNC_TRANSFORM_UNARY_INVOKER( transform_unary_async_invoker, THRUST_FWD(first), THRUST_FWD(last), THRUST_FWD(output), THRUST_FWD(op)); @@ -429,5 +427,3 @@ DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES_AND_NAME( test_async_transform_using_divide_by_2); /////////////////////////////////////////////////////////////////////////////// - -#endif diff --git a/thrust/testing/event.cu b/thrust/testing/event.cu index db26adf74f2..dba5bb8bb51 100644 --- a/thrust/testing/event.cu +++ b/thrust/testing/event.cu @@ -1,11 +1,9 @@ #include -#if _CCCL_STD_VER >= 2014 +#include -# include - -# include -# include +#include +#include // note: there is no matching _CCCL_SUPPRESS_DEPRECATED_POP, so the warning suppression leaks into more content of the // generated cudafe1.stub.c file. @@ -153,5 +151,3 @@ _CCCL_HOST void test_event_when_all() DECLARE_UNITTEST(test_event_when_all); /////////////////////////////////////////////////////////////////////////////// - -#endif diff --git a/thrust/testing/functional.cu b/thrust/testing/functional.cu index 1818084fb34..a0e224e0605 100644 --- a/thrust/testing/functional.cu +++ b/thrust/testing/functional.cu @@ -315,14 +315,6 @@ THRUST_DISABLE_BROKEN_GCC_VECTORIZER void TestNot1() } DECLARE_INTEGRAL_VECTOR_UNITTEST(TestNot1); -// GCC 11 fails to build this test case with a spurious error in a -// very specific scenario: -// - GCC 11 -// - CPP system for both host and device -// - C++11 dialect -#if !(_CCCL_COMPILER(GCC, >=, 11) && _CCCL_COMPILER(GCC, <, 12) && THRUST_HOST_SYSTEM == THRUST_HOST_SYSTEM_CPP \ - && THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CPP && _CCCL_STD_VER == 2011) - template THRUST_DISABLE_BROKEN_GCC_VECTORIZER void TestNot2() { @@ -340,6 +332,4 @@ THRUST_DISABLE_BROKEN_GCC_VECTORIZER void TestNot2() } DECLARE_VECTOR_UNITTEST(TestNot2); -#endif // Weird GCC11 failure case - _CCCL_DIAG_POP diff --git a/thrust/testing/functional_placeholders_miscellaneous.cu b/thrust/testing/functional_placeholders_miscellaneous.cu index 9af8065a9e6..255be6527c6 100644 --- a/thrust/testing/functional_placeholders_miscellaneous.cu +++ b/thrust/testing/functional_placeholders_miscellaneous.cu @@ -104,8 +104,6 @@ void TestFunctionalPlaceholdersSemiRegular() expr3 = expr; // copy-assignable ASSERT_EQUAL(expr3(2, 3), 13); -#if _CCCL_STD_VER >= 2014 static_assert(::cuda::std::semiregular, ""); -#endif // _CCCL_STD_VER >= 2014 } DECLARE_UNITTEST(TestFunctionalPlaceholdersSemiRegular); diff --git a/thrust/testing/future.cu b/thrust/testing/future.cu index 9b8921eeea3..da79d0e944a 100644 --- a/thrust/testing/future.cu +++ b/thrust/testing/future.cu @@ -1,11 +1,9 @@ #include -#if _CCCL_STD_VER >= 2014 +#include -# include - -# include -# include +#include +#include // note: there is no matching _CCCL_SUPPRESS_DEPRECATED_POP, so the warning suppression leaks into more content of the // generated cudafe1.stub.c file. @@ -202,5 +200,3 @@ struct test_future_when_all DECLARE_GENERIC_UNITTEST_WITH_TYPES(test_future_when_all, future_value_types); /////////////////////////////////////////////////////////////////////////////// - -#endif diff --git a/thrust/testing/is_contiguous_iterator.cu b/thrust/testing/is_contiguous_iterator.cu index d0fc6a8cfc7..00162cb1dfa 100644 --- a/thrust/testing/is_contiguous_iterator.cu +++ b/thrust/testing/is_contiguous_iterator.cu @@ -1,36 +1,31 @@ #include - -#include -#include -#include -#include -#include -#include - -#include -#if _CCCL_STD_VER >= 2017 -# include -#endif #include #include #include #include #include +#include #include +#include #include #include #include +#include +#include +#include +#include +#include + +#include THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator::value)); THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator::value)); -#if _CCCL_STD_VER >= 2017 THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator::value)); THRUST_STATIC_ASSERT((thrust::is_contiguous_iterator::value)); -#endif THRUST_STATIC_ASSERT((!thrust::is_contiguous_iterator::iterator>::value)); diff --git a/thrust/testing/is_operator_function_object.cu b/thrust/testing/is_operator_function_object.cu index e30694c0ac3..3863c20a6d6 100644 --- a/thrust/testing/is_operator_function_object.cu +++ b/thrust/testing/is_operator_function_object.cu @@ -4,7 +4,6 @@ #include -#if _CCCL_STD_VER >= 2014 THRUST_STATIC_ASSERT((thrust::is_operator_less_function_object>::value)); THRUST_STATIC_ASSERT((thrust::is_operator_greater_function_object>::value)); @@ -14,7 +13,6 @@ THRUST_STATIC_ASSERT((thrust::is_operator_less_or_greater_function_object>::value)); THRUST_STATIC_ASSERT((thrust::is_operator_plus_function_object>::value)); -#endif template _CCCL_HOST void test_is_operator_less_function_object() diff --git a/thrust/testing/pair.cu b/thrust/testing/pair.cu index 92867675432..4a21acdc91d 100644 --- a/thrust/testing/pair.cu +++ b/thrust/testing/pair.cu @@ -311,7 +311,6 @@ void TestPairSwap() } DECLARE_UNITTEST(TestPairSwap); -#if _CCCL_STD_VER >= 2017 void TestPairStructuredBindings() { const int a = 42; @@ -335,4 +334,3 @@ void TestPairCTAD(void) ASSERT_EQUAL(b, b2); } DECLARE_UNITTEST(TestPairCTAD); -#endif // _CCCL_STD_VER >= 2017 diff --git a/thrust/testing/replace.cu b/thrust/testing/replace.cu index d293bc451d8..34713fd2aa2 100644 --- a/thrust/testing/replace.cu +++ b/thrust/testing/replace.cu @@ -12,11 +12,6 @@ # define THRUST_DISABLE_BROKEN_GCC_VECTORIZER #endif -// GCC 12 + omp + c++11 miscompiles some test cases and emits spurious warnings. -#if _CCCL_COMPILER(GCC, ==, 12) && THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_OMP && _CCCL_STD_VER == 2011 -# define THRUST_GCC12_OMP_MISCOMPILE -#endif - // New GCC, new miscompile. 13 + TBB this time. #if _CCCL_COMPILER(GCC, ==, 13) && THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_TBB # define THRUST_GCC13_TBB_MISCOMPILE @@ -88,7 +83,6 @@ void TestReplace(const size_t n) DECLARE_VARIABLE_UNITTEST(TestReplace); #ifndef THRUST_GCC13_TBB_MISCOMPILE -# ifndef THRUST_GCC12_OMP_MISCOMPILE template THRUST_DISABLE_BROKEN_GCC_VECTORIZER void TestReplaceCopySimple() { @@ -105,7 +99,6 @@ THRUST_DISABLE_BROKEN_GCC_VECTORIZER void TestReplaceCopySimple() ASSERT_EQUAL(dest, result); } DECLARE_VECTOR_UNITTEST(TestReplaceCopySimple); -# endif #endif template diff --git a/thrust/testing/tuple.cu b/thrust/testing/tuple.cu index 5ac40a58fcd..cc9f6803496 100644 --- a/thrust/testing/tuple.cu +++ b/thrust/testing/tuple.cu @@ -498,7 +498,6 @@ void TestTupleSwap() } DECLARE_UNITTEST(TestTupleSwap); -#if _CCCL_STD_VER >= 2017 void TestTupleStructuredBindings() { const int a = 0; @@ -526,4 +525,3 @@ void TestTupleCTAD(void) ASSERT_EQUAL(c, c2); } DECLARE_UNITTEST(TestTupleCTAD); -#endif // _CCCL_STD_VER >= 2017 diff --git a/thrust/testing/unittest/util_async.h b/thrust/testing/unittest/util_async.h index 15293598b12..7a1b0d7e4d9 100644 --- a/thrust/testing/unittest/util_async.h +++ b/thrust/testing/unittest/util_async.h @@ -2,15 +2,13 @@ #include -#if _CCCL_STD_VER >= 2014 +#include -# include +#include -# include +#define TEST_EVENT_WAIT(e) ::unittest::test_event_wait(e, __FILE__, __LINE__) /**/ -# define TEST_EVENT_WAIT(e) ::unittest::test_event_wait(e, __FILE__, __LINE__) /**/ - -# define TEST_FUTURE_VALUE_RETRIEVAL(f) ::unittest::test_future_value_retrieval(f, __FILE__, __LINE__) /**/ +#define TEST_FUTURE_VALUE_RETRIEVAL(f) ::unittest::test_future_value_retrieval(f, __FILE__, __LINE__) /**/ namespace unittest { @@ -58,5 +56,3 @@ _CCCL_HOST auto test_future_value_retrieval(Future&& f, std::string const& filen } } // namespace unittest - -#endif // _CCCL_STD_VER >= 2014 diff --git a/thrust/thrust/async/copy.h b/thrust/thrust/async/copy.h index b05f62970de..2be0bdffa33 100644 --- a/thrust/thrust/async/copy.h +++ b/thrust/thrust/async/copy.h @@ -30,14 +30,12 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include -# include -# include -# include -# include - -# include +#include THRUST_NAMESPACE_BEGIN @@ -132,5 +130,3 @@ _CCCL_GLOBAL_CONSTANT copy_detail::copy_fn copy{}; } // namespace async THRUST_NAMESPACE_END - -#endif diff --git a/thrust/thrust/async/for_each.h b/thrust/thrust/async/for_each.h index 817d1881ac4..7c654678a0f 100644 --- a/thrust/thrust/async/for_each.h +++ b/thrust/thrust/async/for_each.h @@ -30,14 +30,12 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include -# include -# include -# include -# include - -# include +#include THRUST_NAMESPACE_BEGIN @@ -107,5 +105,3 @@ _CCCL_GLOBAL_CONSTANT for_each_detail::for_each_fn for_each{}; } // namespace async THRUST_NAMESPACE_END - -#endif diff --git a/thrust/thrust/async/reduce.h b/thrust/thrust/async/reduce.h index 9e275cd0b9d..abad8d639ef 100644 --- a/thrust/thrust/async/reduce.h +++ b/thrust/thrust/async/reduce.h @@ -30,16 +30,14 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include +#include +#include -# include -# include -# include -# include -# include -# include - -# include +#include THRUST_NAMESPACE_BEGIN @@ -322,5 +320,3 @@ _CCCL_GLOBAL_CONSTANT reduce_into_detail::reduce_into_fn reduce_into{}; } // namespace async THRUST_NAMESPACE_END - -#endif diff --git a/thrust/thrust/async/scan.h b/thrust/thrust/async/scan.h index 42a42c91b10..a4714923e9e 100644 --- a/thrust/thrust/async/scan.h +++ b/thrust/thrust/async/scan.h @@ -30,17 +30,15 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include +#include +#include +#include -# include -# include -# include -# include -# include -# include -# include - -# include +#include THRUST_NAMESPACE_BEGIN @@ -313,5 +311,3 @@ _CCCL_GLOBAL_CONSTANT exclusive_scan_detail::exclusive_scan_fn exclusive_scan{}; } // namespace async THRUST_NAMESPACE_END - -#endif diff --git a/thrust/thrust/async/sort.h b/thrust/thrust/async/sort.h index 9f2d13ee5c2..9edd45fc2ff 100644 --- a/thrust/thrust/async/sort.h +++ b/thrust/thrust/async/sort.h @@ -30,16 +30,14 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include +#include +#include -# include -# include -# include -# include -# include -# include - -# include +#include THRUST_NAMESPACE_BEGIN @@ -289,5 +287,3 @@ _CCCL_GLOBAL_CONSTANT sort_detail::sort_fn sort{}; } // namespace async THRUST_NAMESPACE_END - -#endif diff --git a/thrust/thrust/async/transform.h b/thrust/thrust/async/transform.h index 6bd93124353..85b153a9b1f 100644 --- a/thrust/thrust/async/transform.h +++ b/thrust/thrust/async/transform.h @@ -30,14 +30,12 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#include +#include +#include +#include -# include -# include -# include -# include - -# include +#include THRUST_NAMESPACE_BEGIN @@ -140,5 +138,3 @@ _CCCL_GLOBAL_CONSTANT transform_detail::transform_fn transform{}; } // namespace async THRUST_NAMESPACE_END - -#endif diff --git a/thrust/thrust/detail/allocator/allocator_traits.h b/thrust/thrust/detail/allocator/allocator_traits.h index 4a87333c226..b61358be8c1 100644 --- a/thrust/thrust/detail/allocator/allocator_traits.h +++ b/thrust/thrust/detail/allocator/allocator_traits.h @@ -83,11 +83,10 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH // The following fields of std::allocator have been deprecated (since C++17). // There's no way to detect it other than explicit specialization. -#if _CCCL_STD_VER >= 2017 -# define THRUST_SPECIALIZE_DEPRECATED(trait_name) \ - template \ - struct trait_name> : false_type \ - {}; +#define THRUST_SPECIALIZE_DEPRECATED(trait_name) \ + template \ + struct trait_name> : false_type \ + {}; THRUST_SPECIALIZE_DEPRECATED(has_is_always_equal) THRUST_SPECIALIZE_DEPRECATED(has_pointer) @@ -95,12 +94,11 @@ THRUST_SPECIALIZE_DEPRECATED(has_const_pointer) THRUST_SPECIALIZE_DEPRECATED(has_reference) THRUST_SPECIALIZE_DEPRECATED(has_const_reference) -# undef THRUST_SPECIALIZE_DEPRECATED +#undef THRUST_SPECIALIZE_DEPRECATED template struct has_rebind, U> : false_type {}; -#endif template struct nested_pointer diff --git a/thrust/thrust/detail/config/memory_resource.h b/thrust/thrust/detail/config/memory_resource.h index 4a41d03655f..8d089ba9ce2 100644 --- a/thrust/thrust/detail/config/memory_resource.h +++ b/thrust/thrust/detail/config/memory_resource.h @@ -33,12 +33,10 @@ #define THRUST_MR_DEFAULT_ALIGNMENT alignof(THRUST_NS_QUALIFIER::detail::max_align_t) -#if _CCCL_STD_VER >= 2017 -# if _CCCL_HAS_INCLUDE() -# define THRUST_MR_STD_MR_HEADER -# define THRUST_MR_STD_MR_NS std::pmr -# elif _CCCL_HAS_INCLUDE() -# define THRUST_MR_STD_MR_HEADER -# define THRUST_MR_STD_MR_NS std::experimental::pmr -# endif +#if _CCCL_HAS_INCLUDE() +# define THRUST_MR_STD_MR_HEADER +# define THRUST_MR_STD_MR_NS std::pmr +#elif _CCCL_HAS_INCLUDE() +# define THRUST_MR_STD_MR_HEADER +# define THRUST_MR_STD_MR_NS std::experimental::pmr #endif diff --git a/thrust/thrust/detail/event_error.h b/thrust/thrust/detail/event_error.h index fb9e6c27b89..6c560fb010f 100644 --- a/thrust/thrust/detail/event_error.h +++ b/thrust/thrust/detail/event_error.h @@ -29,12 +29,10 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#include +#include -# include -# include - -# include +#include THRUST_NAMESPACE_BEGIN @@ -160,5 +158,3 @@ inline bool operator<(event_error const& lhs, event_error const& rhs) noexcept } THRUST_NAMESPACE_END - -#endif // C++14 diff --git a/thrust/thrust/detail/static_assert.h b/thrust/thrust/detail/static_assert.h index d21dcbdfbf2..b0427bcb707 100644 --- a/thrust/thrust/detail/static_assert.h +++ b/thrust/thrust/detail/static_assert.h @@ -48,11 +48,7 @@ struct depend_on_instantiation static constexpr bool value = x; }; -#if _CCCL_STD_VER >= 2017 -# define THRUST_STATIC_ASSERT(B) static_assert(B) -#else -# define THRUST_STATIC_ASSERT(B) static_assert(B, "static assertion failed") -#endif +#define THRUST_STATIC_ASSERT(B) static_assert(B) #define THRUST_STATIC_ASSERT_MSG(B, msg) static_assert(B, msg) } // namespace detail diff --git a/thrust/thrust/future.h b/thrust/thrust/future.h index 15391d07177..15ab1d7627d 100644 --- a/thrust/thrust/future.h +++ b/thrust/thrust/future.h @@ -30,12 +30,10 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#include +#include -# include -# include - -# include +#include /* // #include the host system's pointer.h header. @@ -45,9 +43,9 @@ */ // #include the device system's pointer.h header. -# define __THRUST_DEVICE_SYSTEM_POINTER_HEADER <__THRUST_DEVICE_SYSTEM_ROOT/pointer.h> -# include __THRUST_DEVICE_SYSTEM_POINTER_HEADER -# undef __THRUST_DEVICE_SYSTEM_POINTER_HEADER +#define __THRUST_DEVICE_SYSTEM_POINTER_HEADER <__THRUST_DEVICE_SYSTEM_ROOT/pointer.h> +#include __THRUST_DEVICE_SYSTEM_POINTER_HEADER +#undef __THRUST_DEVICE_SYSTEM_POINTER_HEADER /* // #include the host system's future.h header. @@ -57,9 +55,9 @@ */ // #include the device system's future.h header. -# define __THRUST_DEVICE_SYSTEM_FUTURE_HEADER <__THRUST_DEVICE_SYSTEM_ROOT/future.h> -# include __THRUST_DEVICE_SYSTEM_FUTURE_HEADER -# undef __THRUST_DEVICE_SYSTEM_FUTURE_HEADER +#define __THRUST_DEVICE_SYSTEM_FUTURE_HEADER <__THRUST_DEVICE_SYSTEM_ROOT/future.h> +#include __THRUST_DEVICE_SYSTEM_FUTURE_HEADER +#undef __THRUST_DEVICE_SYSTEM_FUTURE_HEADER _CCCL_SUPPRESS_DEPRECATED_PUSH THRUST_NAMESPACE_BEGIN @@ -162,10 +160,10 @@ using device_future CCCL_DEPRECATED = device_unique_eager_future; struct CCCL_DEPRECATED new_stream_t final {}; -# ifndef CCCL_HEADER_MACRO_CHECK +#ifndef CCCL_HEADER_MACRO_CHECK // when building header tests, we get a deprecation warning from cudafe1.stub.c if we deprecate a global variable CCCL_DEPRECATED -# endif +#endif _CCCL_GLOBAL_CONSTANT new_stream_t new_stream{}; /////////////////////////////////////////////////////////////////////////////// @@ -176,5 +174,3 @@ using thrust::system::__THRUST_DEVICE_SYSTEM_NAMESPACE::when_all; _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END - -#endif diff --git a/thrust/thrust/optional.h b/thrust/thrust/optional.h index 33da23ec10b..84feb531cf1 100644 --- a/thrust/thrust/optional.h +++ b/thrust/thrust/optional.h @@ -43,19 +43,6 @@ _CCCL_SUPPRESS_DEPRECATED_PUSH # define THRUST_OPTIONAL_MSVC2015 #endif -#if _CCCL_STD_VER > 2011 -# define THRUST_OPTIONAL_CPP14 -#endif - -// constexpr implies const in C++11, not C++14 -#if (_CCCL_STD_VER == 2011 || defined(THRUST_OPTIONAL_MSVC2015) || defined(THRUST_OPTIONAL_GCC49)) -/// \exclude -# define THRUST_OPTIONAL_CPP11_CONSTEXPR -#else -/// \exclude -# define THRUST_OPTIONAL_CPP11_CONSTEXPR constexpr -#endif - THRUST_NAMESPACE_BEGIN #ifndef THRUST_MONOSTATE_INPLACE_MUTEX @@ -104,47 +91,6 @@ template struct conjunction : std::conditional, B>::type {}; -# if defined(_LIBCPP_VERSION) && _CCCL_STD_VER == 2011 -# define THRUST_OPTIONAL_LIBCXX_MEM_FN_WORKAROUND -# endif - -// In C++11 mode, there's an issue in libc++'s std::mem_fn -// which results in a hard-error when using it in a noexcept expression -// in some cases. This is a check to workaround the common failing case. -# ifdef THRUST_OPTIONAL_LIBCXX_MEM_FN_WORKAROUND -template -struct is_pointer_to_non_const_member_func : std::false_type -{}; -template -struct is_pointer_to_non_const_member_func : std::true_type -{}; -template -struct is_pointer_to_non_const_member_func : std::true_type -{}; -template -struct is_pointer_to_non_const_member_func : std::true_type -{}; -template -struct is_pointer_to_non_const_member_func : std::true_type -{}; -template -struct is_pointer_to_non_const_member_func : std::true_type -{}; -template -struct is_pointer_to_non_const_member_func : std::true_type -{}; - -template -struct is_const_or_const_ref : std::false_type -{}; -template -struct is_const_or_const_ref : std::true_type -{}; -template -struct is_const_or_const_ref : std::true_type -{}; -# endif - // std::invoke from C++17 // https://stackoverflow.com/questions/38288042/c11-14-invoke-workaround _CCCL_EXEC_CHECK_DISABLE @@ -319,14 +265,14 @@ template ::value> struct optional_storage_base { _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional_storage_base() noexcept + _CCCL_HOST_DEVICE constexpr optional_storage_base() noexcept : m_dummy() , m_has_value(false) {} _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional_storage_base(in_place_t, U&&... u) + _CCCL_HOST_DEVICE constexpr optional_storage_base(in_place_t, U&&... u) : m_value(std::forward(u)...) , m_has_value(true) {} @@ -357,14 +303,14 @@ template struct optional_storage_base { _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional_storage_base() noexcept + _CCCL_HOST_DEVICE constexpr optional_storage_base() noexcept : m_dummy() , m_has_value(false) {} _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional_storage_base(in_place_t, U&&... u) + _CCCL_HOST_DEVICE constexpr optional_storage_base(in_place_t, U&&... u) : m_value(std::forward(u)...) , m_has_value(true) {} @@ -434,17 +380,17 @@ struct optional_operations_base : optional_storage_base } _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR T& get() & + _CCCL_HOST_DEVICE constexpr T& get() & { return this->m_value; } _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR const T& get() const& + _CCCL_HOST_DEVICE constexpr const T& get() const& { return this->m_value; } _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR T&& get() && + _CCCL_HOST_DEVICE constexpr T&& get() && { return std::move(this->m_value); } @@ -779,8 +725,7 @@ class optional // types are not SFINAE-safe. This provides better support for things like // generic lambdas. C.f. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0826r0 -#if defined(THRUST_OPTIONAL_CPP14) && !defined(THRUST_OPTIONAL_GCC49) && !defined(THRUST_OPTIONAL_GCC54) \ - && !defined(THRUST_OPTIONAL_GCC55) +#if !defined(THRUST_OPTIONAL_GCC49) && !defined(THRUST_OPTIONAL_GCC54) && !defined(THRUST_OPTIONAL_GCC55) /// \group and_then /// Carries out some operation which returns an optional on the stored /// object if there is one. \requires `std::invoke(std::forward(f), @@ -793,7 +738,7 @@ class optional /// \synopsis template \nconstexpr auto and_then(F &&f) &; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR auto and_then(F&& f) & + _CCCL_HOST_DEVICE constexpr auto and_then(F&& f) & { using result = detail::invoke_result_t; static_assert(detail::is_optional::value, "F must return an optional"); @@ -805,7 +750,7 @@ class optional /// \synopsis template \nconstexpr auto and_then(F &&f) &&; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR auto and_then(F&& f) && + _CCCL_HOST_DEVICE constexpr auto and_then(F&& f) && { using result = detail::invoke_result_t; static_assert(detail::is_optional::value, "F must return an optional"); @@ -851,7 +796,7 @@ class optional /// \synopsis template \nconstexpr auto and_then(F &&f) &; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR detail::invoke_result_t and_then(F&& f) & + _CCCL_HOST_DEVICE constexpr detail::invoke_result_t and_then(F&& f) & { using result = detail::invoke_result_t; static_assert(detail::is_optional::value, "F must return an optional"); @@ -863,7 +808,7 @@ class optional /// \synopsis template \nconstexpr auto and_then(F &&f) &&; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR detail::invoke_result_t and_then(F&& f) && + _CCCL_HOST_DEVICE constexpr detail::invoke_result_t and_then(F&& f) && { using result = detail::invoke_result_t; static_assert(detail::is_optional::value, "F must return an optional"); @@ -898,8 +843,7 @@ class optional # endif #endif -#if defined(THRUST_OPTIONAL_CPP14) && !defined(THRUST_OPTIONAL_GCC49) && !defined(THRUST_OPTIONAL_GCC54) \ - && !defined(THRUST_OPTIONAL_GCC55) +#if !defined(THRUST_OPTIONAL_GCC49) && !defined(THRUST_OPTIONAL_GCC54) && !defined(THRUST_OPTIONAL_GCC55) /// \brief Carries out some operation on the stored object if there is one. /// \return Let `U` be the result of `std::invoke(std::forward(f), /// value())`. Returns a `std::optional`. The return value is empty if @@ -911,7 +855,7 @@ class optional /// \synopsis template constexpr auto map(F &&f) &; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR auto map(F&& f) & + _CCCL_HOST_DEVICE constexpr auto map(F&& f) & { return optional_map_impl(*this, std::forward(f)); } @@ -920,7 +864,7 @@ class optional /// \synopsis template constexpr auto map(F &&f) &&; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR auto map(F&& f) && + _CCCL_HOST_DEVICE constexpr auto map(F&& f) && { return optional_map_impl(std::move(*this), std::forward(f)); } @@ -954,9 +898,7 @@ class optional /// \synopsis template auto map(F &&f) &; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE - THRUST_OPTIONAL_CPP11_CONSTEXPR decltype(optional_map_impl(std::declval(), std::declval())) - map(F&& f) & + _CCCL_HOST_DEVICE constexpr decltype(optional_map_impl(std::declval(), std::declval())) map(F&& f) & { return optional_map_impl(*this, std::forward(f)); } @@ -965,9 +907,7 @@ class optional /// \synopsis template auto map(F &&f) &&; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE - THRUST_OPTIONAL_CPP11_CONSTEXPR decltype(optional_map_impl(std::declval(), std::declval())) - map(F&& f) && + _CCCL_HOST_DEVICE constexpr decltype(optional_map_impl(std::declval(), std::declval())) map(F&& f) && { return optional_map_impl(std::move(*this), std::forward(f)); } @@ -1006,7 +946,7 @@ class optional /// \synopsis template optional or_else (F &&f) &; _CCCL_EXEC_CHECK_DISABLE template * = nullptr> - _CCCL_HOST_DEVICE optional THRUST_OPTIONAL_CPP11_CONSTEXPR or_else(F&& f) & + _CCCL_HOST_DEVICE optional constexpr or_else(F&& f) & { if (has_value()) { @@ -1020,7 +960,7 @@ class optional /// \exclude _CCCL_EXEC_CHECK_DISABLE template * = nullptr> - _CCCL_HOST_DEVICE optional THRUST_OPTIONAL_CPP11_CONSTEXPR or_else(F&& f) & + _CCCL_HOST_DEVICE optional constexpr or_else(F&& f) & { return has_value() ? *this : std::forward(f)(); } @@ -1043,7 +983,7 @@ class optional /// \exclude _CCCL_EXEC_CHECK_DISABLE template * = nullptr> - _CCCL_HOST_DEVICE optional THRUST_OPTIONAL_CPP11_CONSTEXPR or_else(F&& f) && + _CCCL_HOST_DEVICE optional constexpr or_else(F&& f) && { return has_value() ? std::move(*this) : std::forward(f)(); } @@ -1066,7 +1006,7 @@ class optional /// \exclude _CCCL_EXEC_CHECK_DISABLE template * = nullptr> - _CCCL_HOST_DEVICE optional THRUST_OPTIONAL_CPP11_CONSTEXPR or_else(F&& f) const& + _CCCL_HOST_DEVICE optional constexpr or_else(F&& f) const& { return has_value() ? *this : std::forward(f)(); } @@ -1195,7 +1135,7 @@ class optional /// \return `rhs` if `*this` is empty, otherwise the current value. /// \group disjunction _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional disjunction(const optional& rhs) & + _CCCL_HOST_DEVICE constexpr optional disjunction(const optional& rhs) & { return has_value() ? *this : rhs; } @@ -1209,7 +1149,7 @@ class optional /// \group disjunction _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional disjunction(const optional& rhs) && + _CCCL_HOST_DEVICE constexpr optional disjunction(const optional& rhs) && { return has_value() ? std::move(*this) : rhs; } @@ -1225,7 +1165,7 @@ class optional /// \group disjunction _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional disjunction(optional&& rhs) & + _CCCL_HOST_DEVICE constexpr optional disjunction(optional&& rhs) & { return has_value() ? *this : std::move(rhs); } @@ -1239,7 +1179,7 @@ class optional /// \group disjunction _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional disjunction(optional&& rhs) && + _CCCL_HOST_DEVICE constexpr optional disjunction(optional&& rhs) && { return has_value() ? std::move(*this) : std::move(rhs); } @@ -1308,14 +1248,14 @@ class optional /// If `rhs` contains a value, the stored value is direct-initialized with /// it. Otherwise, the constructed optional is empty. _CCCL_EXEC_CHECK_DISABLE - THRUST_OPTIONAL_CPP11_CONSTEXPR optional(const optional& rhs) = default; + constexpr optional(const optional& rhs) = default; /// Move constructor /// /// If `rhs` contains a value, the stored value is direct-initialized with /// it. Otherwise, the constructed optional is empty. _CCCL_EXEC_CHECK_DISABLE - THRUST_OPTIONAL_CPP11_CONSTEXPR optional(optional&& rhs) = default; + constexpr optional(optional&& rhs) = default; /// Constructs the stored value in-place using the given arguments. /// \group in_place @@ -1332,7 +1272,7 @@ class optional /// Args&&... args); _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR explicit optional( + _CCCL_HOST_DEVICE constexpr explicit optional( detail::enable_if_t&, Args&&...>::value, in_place_t>, std::initializer_list il, Args&&... args) @@ -1581,7 +1521,7 @@ class optional /// \group pointer /// \synopsis constexpr T *operator->(); _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR T* operator->() + _CCCL_HOST_DEVICE constexpr T* operator->() { return ::cuda::std::addressof(this->m_value); } @@ -1591,7 +1531,7 @@ class optional /// \group deref /// \synopsis constexpr T &operator*(); _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR T& operator*() & + _CCCL_HOST_DEVICE constexpr T& operator*() & { return this->m_value; } @@ -1606,7 +1546,7 @@ class optional /// \exclude _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR T&& operator*() && + _CCCL_HOST_DEVICE constexpr T&& operator*() && { return std::move(this->m_value); } @@ -1639,7 +1579,7 @@ class optional /// [bad_optional_access] /// \group value /// \synopsis constexpr T &value(); - _CCCL_HOST THRUST_OPTIONAL_CPP11_CONSTEXPR T& value() & + _CCCL_HOST constexpr T& value() & { if (has_value()) { @@ -1649,7 +1589,7 @@ class optional } /// \group value /// \synopsis constexpr const T &value() const; - _CCCL_HOST THRUST_OPTIONAL_CPP11_CONSTEXPR const T& value() const& + _CCCL_HOST constexpr const T& value() const& { if (has_value()) { @@ -1658,7 +1598,7 @@ class optional throw bad_optional_access(); } /// \exclude - _CCCL_HOST THRUST_OPTIONAL_CPP11_CONSTEXPR T&& value() && + _CCCL_HOST constexpr T&& value() && { if (has_value()) { @@ -1669,7 +1609,7 @@ class optional #ifndef THRUST_OPTIONAL_NO_CONSTRR /// \exclude - _CCCL_HOST THRUST_OPTIONAL_CPP11_CONSTEXPR const T&& value() const&& + _CCCL_HOST constexpr const T&& value() const&& { if (has_value()) { @@ -1693,7 +1633,7 @@ class optional /// \group value_or _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR T value_or(U&& u) && + _CCCL_HOST_DEVICE constexpr T value_or(U&& u) && { static_assert(std::is_move_constructible::value && std::is_convertible::value, "T must be move constructible and convertible from U"); @@ -1977,17 +1917,14 @@ _CCCL_HOST_DEVICE inline constexpr optional make_optional(std::initializer_li return optional(in_place, il, std::forward(args)...); } -#if _CCCL_STD_VER >= 2017 template optional(T) -> optional; -#endif // Doxygen chokes on the trailing return types used below. #if !defined(_CCCL_DOXYGEN_INVOKED) /// \exclude namespace detail { -# ifdef THRUST_OPTIONAL_CPP14 _CCCL_EXEC_CHECK_DISABLE template (f), *std::forward(opt)); -# if _CCCL_COMPILER(MSVC) +# if _CCCL_COMPILER(MSVC) // MSVC fails to suppress the warning on make_optional _CCCL_SUPPRESS_DEPRECATED_PUSH return optional(monostate{}); _CCCL_SUPPRESS_DEPRECATED_POP -# elif _CCCL_COMPILER(NVHPC) +# elif _CCCL_COMPILER(NVHPC) // NVHPC cannot have a diagnostic pop after a return statement _CCCL_SUPPRESS_DEPRECATED_PUSH auto o = optional(monostate{}); _CCCL_SUPPRESS_DEPRECATED_POP return ::cuda::std::move(o); -# else +# else _CCCL_SUPPRESS_DEPRECATED_PUSH return make_optional(monostate{}); _CCCL_SUPPRESS_DEPRECATED_POP -# endif +# endif } return optional(nullopt); } -# else -_CCCL_EXEC_CHECK_DISABLE -template (), *std::declval())), - detail::enable_if_t::value>* = nullptr> -_CCCL_HOST_DEVICE constexpr optional optional_map_impl(Opt&& opt, F&& f) -{ - return opt.has_value() ? detail::invoke(std::forward(f), *std::forward(opt)) : optional(nullopt); -} -_CCCL_EXEC_CHECK_DISABLE -template (), *std::declval())), - detail::enable_if_t::value>* = nullptr> -_CCCL_HOST_DEVICE auto optional_map_impl(Opt&& opt, F&& f) -> optional -{ - if (opt.has_value()) - { - detail::invoke(std::forward(f), *std::forward(opt)); - return monostate{}; - } - - return nullopt; -} -# endif } // namespace detail #endif // !defined(_CCCL_DOXYGEN_INVOKED) @@ -2088,8 +1999,7 @@ class optional // types are not SFINAE-safe. This provides better support for things like // generic lambdas. C.f. // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0826r0 -#if defined(THRUST_OPTIONAL_CPP14) && !defined(THRUST_OPTIONAL_GCC49) && !defined(THRUST_OPTIONAL_GCC54) \ - && !defined(THRUST_OPTIONAL_GCC55) +#if !defined(THRUST_OPTIONAL_GCC49) && !defined(THRUST_OPTIONAL_GCC54) && !defined(THRUST_OPTIONAL_GCC55) /// \group and_then /// Carries out some operation which returns an optional on the stored /// object if there is one. \requires `std::invoke(std::forward(f), @@ -2102,7 +2012,7 @@ class optional /// \synopsis template \nconstexpr auto and_then(F &&f) &; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR auto and_then(F&& f) & + _CCCL_HOST_DEVICE constexpr auto and_then(F&& f) & { using result = detail::invoke_result_t; static_assert(detail::is_optional::value, "F must return an optional"); @@ -2114,7 +2024,7 @@ class optional /// \synopsis template \nconstexpr auto and_then(F &&f) &&; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR auto and_then(F&& f) && + _CCCL_HOST_DEVICE constexpr auto and_then(F&& f) && { using result = detail::invoke_result_t; static_assert(detail::is_optional::value, "F must return an optional"); @@ -2160,7 +2070,7 @@ class optional /// \synopsis template \nconstexpr auto and_then(F &&f) &; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR detail::invoke_result_t and_then(F&& f) & + _CCCL_HOST_DEVICE constexpr detail::invoke_result_t and_then(F&& f) & { using result = detail::invoke_result_t; static_assert(detail::is_optional::value, "F must return an optional"); @@ -2172,7 +2082,7 @@ class optional /// \synopsis template \nconstexpr auto and_then(F &&f) &&; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR detail::invoke_result_t and_then(F&& f) && + _CCCL_HOST_DEVICE constexpr detail::invoke_result_t and_then(F&& f) && { using result = detail::invoke_result_t; static_assert(detail::is_optional::value, "F must return an optional"); @@ -2207,8 +2117,7 @@ class optional # endif #endif -#if defined(THRUST_OPTIONAL_CPP14) && !defined(THRUST_OPTIONAL_GCC49) && !defined(THRUST_OPTIONAL_GCC54) \ - && !defined(THRUST_OPTIONAL_GCC55) +#if !defined(THRUST_OPTIONAL_GCC49) && !defined(THRUST_OPTIONAL_GCC54) && !defined(THRUST_OPTIONAL_GCC55) /// \brief Carries out some operation on the stored object if there is one. /// \return Let `U` be the result of `std::invoke(std::forward(f), /// value())`. Returns a `std::optional`. The return value is empty if @@ -2220,7 +2129,7 @@ class optional /// \synopsis template constexpr auto map(F &&f) &; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR auto map(F&& f) & + _CCCL_HOST_DEVICE constexpr auto map(F&& f) & { return detail::optional_map_impl(*this, std::forward(f)); } @@ -2229,7 +2138,7 @@ class optional /// \synopsis template constexpr auto map(F &&f) &&; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR auto map(F&& f) && + _CCCL_HOST_DEVICE constexpr auto map(F&& f) && { return detail::optional_map_impl(std::move(*this), std::forward(f)); } @@ -2263,8 +2172,7 @@ class optional /// \synopsis template auto map(F &&f) &; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE - THRUST_OPTIONAL_CPP11_CONSTEXPR decltype(detail::optional_map_impl(std::declval(), std::declval())) + _CCCL_HOST_DEVICE constexpr decltype(detail::optional_map_impl(std::declval(), std::declval())) map(F&& f) & { return detail::optional_map_impl(*this, std::forward(f)); @@ -2274,8 +2182,7 @@ class optional /// \synopsis template auto map(F &&f) &&; _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE - THRUST_OPTIONAL_CPP11_CONSTEXPR decltype(detail::optional_map_impl(std::declval(), std::declval())) + _CCCL_HOST_DEVICE constexpr decltype(detail::optional_map_impl(std::declval(), std::declval())) map(F&& f) && { return detail::optional_map_impl(std::move(*this), std::forward(f)); @@ -2314,7 +2221,7 @@ class optional /// \synopsis template optional or_else (F &&f) &; _CCCL_EXEC_CHECK_DISABLE template * = nullptr> - _CCCL_HOST_DEVICE optional THRUST_OPTIONAL_CPP11_CONSTEXPR or_else(F&& f) & + _CCCL_HOST_DEVICE optional constexpr or_else(F&& f) & { if (has_value()) { @@ -2328,7 +2235,7 @@ class optional /// \exclude _CCCL_EXEC_CHECK_DISABLE template * = nullptr> - _CCCL_HOST_DEVICE optional THRUST_OPTIONAL_CPP11_CONSTEXPR or_else(F&& f) & + _CCCL_HOST_DEVICE optional constexpr or_else(F&& f) & { return has_value() ? *this : std::forward(f)(); } @@ -2351,7 +2258,7 @@ class optional /// \exclude _CCCL_EXEC_CHECK_DISABLE template * = nullptr> - _CCCL_HOST_DEVICE optional THRUST_OPTIONAL_CPP11_CONSTEXPR or_else(F&& f) && + _CCCL_HOST_DEVICE optional constexpr or_else(F&& f) && { return has_value() ? std::move(*this) : std::forward(f)(); } @@ -2374,7 +2281,7 @@ class optional /// \exclude _CCCL_EXEC_CHECK_DISABLE template * = nullptr> - _CCCL_HOST_DEVICE optional THRUST_OPTIONAL_CPP11_CONSTEXPR or_else(F&& f) const& + _CCCL_HOST_DEVICE optional constexpr or_else(F&& f) const& { return has_value() ? *this : std::forward(f)(); } @@ -2503,7 +2410,7 @@ class optional /// \return `rhs` if `*this` is empty, otherwise the current value. /// \group disjunction _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional disjunction(const optional& rhs) & + _CCCL_HOST_DEVICE constexpr optional disjunction(const optional& rhs) & { return has_value() ? *this : rhs; } @@ -2517,7 +2424,7 @@ class optional /// \group disjunction _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional disjunction(const optional& rhs) && + _CCCL_HOST_DEVICE constexpr optional disjunction(const optional& rhs) && { return has_value() ? std::move(*this) : rhs; } @@ -2533,7 +2440,7 @@ class optional /// \group disjunction _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional disjunction(optional&& rhs) & + _CCCL_HOST_DEVICE constexpr optional disjunction(optional&& rhs) & { return has_value() ? *this : std::move(rhs); } @@ -2547,7 +2454,7 @@ class optional /// \group disjunction _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR optional disjunction(optional&& rhs) && + _CCCL_HOST_DEVICE constexpr optional disjunction(optional&& rhs) && { return has_value() ? std::move(*this) : std::move(rhs); } @@ -2620,14 +2527,14 @@ class optional /// If `rhs` contains a value, the stored value is direct-initialized with /// it. Otherwise, the constructed optional is empty. _CCCL_EXEC_CHECK_DISABLE - THRUST_OPTIONAL_CPP11_CONSTEXPR optional(const optional& rhs) noexcept = default; + constexpr optional(const optional& rhs) noexcept = default; /// Move constructor /// /// If `rhs` contains a value, the stored value is direct-initialized with /// it. Otherwise, the constructed optional is empty. _CCCL_EXEC_CHECK_DISABLE - THRUST_OPTIONAL_CPP11_CONSTEXPR optional(optional&& rhs) = default; + constexpr optional(optional&& rhs) = default; /// Constructs the stored value with `u`. /// \synopsis template constexpr optional(U &&u); @@ -2729,7 +2636,7 @@ class optional /// \group pointer /// \synopsis constexpr T *operator->(); _CCCL_EXEC_CHECK_DISABLE - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR T* operator->() + _CCCL_HOST_DEVICE constexpr T* operator->() { return m_value; } @@ -2739,7 +2646,7 @@ class optional /// \group deref /// \synopsis constexpr T &operator*(); _CCCL_EXEC_CHECK_DISABLE - THRUST_OPTIONAL_CPP11_CONSTEXPR T& operator*() + constexpr T& operator*() { return *m_value; } @@ -2771,7 +2678,7 @@ class optional /// [bad_optional_access] /// \group value /// synopsis constexpr T &value(); - _CCCL_HOST THRUST_OPTIONAL_CPP11_CONSTEXPR T& value() + _CCCL_HOST constexpr T& value() { if (has_value()) { @@ -2781,7 +2688,7 @@ class optional } /// \group value /// \synopsis constexpr const T &value() const; - _CCCL_HOST THRUST_OPTIONAL_CPP11_CONSTEXPR const T& value() const + _CCCL_HOST constexpr const T& value() const { if (has_value()) { @@ -2804,7 +2711,7 @@ class optional /// \group value_or _CCCL_EXEC_CHECK_DISABLE template - _CCCL_HOST_DEVICE THRUST_OPTIONAL_CPP11_CONSTEXPR T value_or(U&& u) && + _CCCL_HOST_DEVICE constexpr T value_or(U&& u) && { static_assert(std::is_move_constructible::value && std::is_convertible::value, "T must be move constructible and convertible from U"); diff --git a/thrust/thrust/system/cuda/detail/async/copy.h b/thrust/thrust/system/cuda/detail/async/copy.h index 04330e071f1..59129b8f431 100644 --- a/thrust/thrust/system/cuda/detail/async/copy.h +++ b/thrust/thrust/system/cuda/detail/async/copy.h @@ -39,26 +39,24 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#if _CCCL_HAS_CUDA_COMPILER -# if _CCCL_HAS_CUDA_COMPILER +# include -# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include - -# include +# include _CCCL_SUPPRESS_DEPRECATED_PUSH THRUST_NAMESPACE_BEGIN @@ -358,6 +356,4 @@ auto async_copy(thrust::cuda::execution_policy& from_exec, _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END -# endif // _CCCL_CUDA_COMPILER - -#endif +#endif // _CCCL_CUDA_COMPILER diff --git a/thrust/thrust/system/cuda/detail/async/customization.h b/thrust/thrust/system/cuda/detail/async/customization.h index 29f0403f7f2..d6a02b61c06 100644 --- a/thrust/thrust/system/cuda/detail/async/customization.h +++ b/thrust/thrust/system/cuda/detail/async/customization.h @@ -41,22 +41,20 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#if _CCCL_HAS_CUDA_COMPILER -# if _CCCL_HAS_CUDA_COMPILER +# include -# include +# include +# include +# include +# include +# include +# include +# include +# include -# include -# include -# include -# include -# include -# include -# include -# include - -# include +# include THRUST_NAMESPACE_BEGIN @@ -107,6 +105,4 @@ auto get_async_universal_host_pinned_allocator(thrust::detail::execution_policy_ THRUST_NAMESPACE_END -# endif // _CCCL_CUDA_COMPILER - -#endif +#endif // _CCCL_CUDA_COMPILER diff --git a/thrust/thrust/system/cuda/detail/async/exclusive_scan.h b/thrust/thrust/system/cuda/detail/async/exclusive_scan.h index 0b910e4982f..8c274340a05 100644 --- a/thrust/thrust/system/cuda/detail/async/exclusive_scan.h +++ b/thrust/thrust/system/cuda/detail/async/exclusive_scan.h @@ -37,21 +37,19 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#if _CCCL_HAS_CUDA_COMPILER -# if _CCCL_HAS_CUDA_COMPILER +# include -# include +# include +# include +# include +# include +# include -# include -# include -# include -# include -# include +# include -# include - -# include +# include // TODO specialize for thrust::plus to use e.g. ExclusiveSum instead of ExcScan @@ -160,6 +158,4 @@ auto async_exclusive_scan( _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END -# endif // _CCCL_CUDA_COMPILER - -#endif // C++14 +#endif // _CCCL_CUDA_COMPILER diff --git a/thrust/thrust/system/cuda/detail/async/for_each.h b/thrust/thrust/system/cuda/detail/async/for_each.h index ebd3772ac31..5ffc99f59ee 100644 --- a/thrust/thrust/system/cuda/detail/async/for_each.h +++ b/thrust/thrust/system/cuda/detail/async/for_each.h @@ -40,20 +40,18 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#if _CCCL_HAS_CUDA_COMPILER -# if _CCCL_HAS_CUDA_COMPILER +# include -# include +# include -# include +# include +# include +# include +# include -# include -# include -# include -# include - -# include +# include _CCCL_SUPPRESS_DEPRECATED_PUSH THRUST_NAMESPACE_BEGIN @@ -130,6 +128,4 @@ auto async_for_each(execution_policy& policy, ForwardIt first, Se _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END -# endif // _CCCL_CUDA_COMPILER - -#endif +#endif // _CCCL_CUDA_COMPILER diff --git a/thrust/thrust/system/cuda/detail/async/inclusive_scan.h b/thrust/thrust/system/cuda/detail/async/inclusive_scan.h index f723a1e31c0..904d3c2a793 100644 --- a/thrust/thrust/system/cuda/detail/async/inclusive_scan.h +++ b/thrust/thrust/system/cuda/detail/async/inclusive_scan.h @@ -37,21 +37,19 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#if _CCCL_HAS_CUDA_COMPILER -# if _CCCL_HAS_CUDA_COMPILER +# include -# include +# include +# include +# include +# include +# include -# include -# include -# include -# include -# include +# include -# include - -# include +# include // TODO specialize for thrust::plus to use e.g. InclusiveSum instead of IncScan @@ -246,6 +244,4 @@ auto async_inclusive_scan( _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END -# endif // _CCCL_CUDA_COMPILER - -#endif // C++14 +#endif // _CCCL_CUDA_COMPILER diff --git a/thrust/thrust/system/cuda/detail/async/reduce.h b/thrust/thrust/system/cuda/detail/async/reduce.h index 41848607260..264b43ecf7e 100644 --- a/thrust/thrust/system/cuda/detail/async/reduce.h +++ b/thrust/thrust/system/cuda/detail/async/reduce.h @@ -41,21 +41,19 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#if _CCCL_HAS_CUDA_COMPILER -# if _CCCL_HAS_CUDA_COMPILER +# include -# include +# include +# include +# include +# include +# include -# include -# include -# include -# include -# include +# include -# include - -# include +# include _CCCL_SUPPRESS_DEPRECATED_PUSH THRUST_NAMESPACE_BEGIN @@ -230,6 +228,4 @@ auto async_reduce_into( _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END -# endif // _CCCL_CUDA_COMPILER - -#endif +#endif // _CCCL_CUDA_COMPILER diff --git a/thrust/thrust/system/cuda/detail/async/sort.h b/thrust/thrust/system/cuda/detail/async/sort.h index b9f29c48335..700aff37e71 100644 --- a/thrust/thrust/system/cuda/detail/async/sort.h +++ b/thrust/thrust/system/cuda/detail/async/sort.h @@ -39,26 +39,24 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#if _CCCL_HAS_CUDA_COMPILER -# if _CCCL_HAS_CUDA_COMPILER +# include -# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include - -# include +# include _CCCL_SUPPRESS_DEPRECATED_PUSH THRUST_NAMESPACE_BEGIN @@ -322,6 +320,4 @@ auto async_stable_sort(execution_policy& policy, ForwardIt first, _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END -# endif // _CCCL_CUDA_COMPILER - -#endif +#endif // _CCCL_CUDA_COMPILER diff --git a/thrust/thrust/system/cuda/detail/async/transform.h b/thrust/thrust/system/cuda/detail/async/transform.h index 56da3e504e8..23e3512ebc6 100644 --- a/thrust/thrust/system/cuda/detail/async/transform.h +++ b/thrust/thrust/system/cuda/detail/async/transform.h @@ -39,22 +39,20 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 +#if _CCCL_HAS_CUDA_COMPILER -# if _CCCL_HAS_CUDA_COMPILER +# include -# include +# include -# include +# include +# include +# include +# include +# include +# include -# include -# include -# include -# include -# include -# include - -# include +# include _CCCL_SUPPRESS_DEPRECATED_PUSH THRUST_NAMESPACE_BEGIN @@ -135,6 +133,4 @@ auto async_transform( _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END -# endif // _CCCL_CUDA_COMPILER - -#endif +#endif // _CCCL_CUDA_COMPILER diff --git a/thrust/thrust/system/cuda/detail/future.inl b/thrust/thrust/system/cuda/detail/future.inl index 1eee3a6216d..48d06a98aad 100644 --- a/thrust/thrust/system/cuda/detail/future.inl +++ b/thrust/thrust/system/cuda/detail/future.inl @@ -18,28 +18,26 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 - -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include - -# include -# include -# include - -# include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include _CCCL_SUPPRESS_DEPRECATED_PUSH THRUST_NAMESPACE_BEGIN @@ -429,12 +427,12 @@ struct async_value : virtual async_signal } // For testing only. -# if defined(THRUST_ENABLE_FUTURE_RAW_DATA_MEMBER) +#if defined(THRUST_ENABLE_FUTURE_RAW_DATA_MEMBER) _CCCL_HOST virtual raw_const_pointer raw_data() const { return nullptr; } -# endif +#endif }; template @@ -521,12 +519,12 @@ public: } // For testing only. -# if defined(THRUST_ENABLE_FUTURE_RAW_DATA_MEMBER) +#if defined(THRUST_ENABLE_FUTURE_RAW_DATA_MEMBER) _CCCL_HOST raw_const_pointer raw_data() const final override { return raw_pointer_cast(content_); } -# endif +#endif }; /////////////////////////////////////////////////////////////////////////////// @@ -641,13 +639,13 @@ public: return std::move(value_); } -# if defined(THRUST_ENABLE_FUTURE_RAW_DATA_MEMBER) +#if defined(THRUST_ENABLE_FUTURE_RAW_DATA_MEMBER) // For testing only. _CCCL_HOST_DEVICE raw_const_pointer data() const { return ::cuda::std::addressof(value_); } -# endif +#endif }; struct CCCL_DEPRECATED unique_eager_event final @@ -895,7 +893,7 @@ public: } // For testing only. -# if defined(THRUST_ENABLE_FUTURE_RAW_DATA_MEMBER) +#if defined(THRUST_ENABLE_FUTURE_RAW_DATA_MEMBER) // Precondition: `true == valid_stream()`. _CCCL_HOST raw_const_pointer raw_data() const { @@ -906,7 +904,7 @@ public: return async_signal_->raw_data(); } -# endif +#endif _CCCL_SUPPRESS_DEPRECATED_PUSH // for thrust::optional template @@ -1230,5 +1228,3 @@ CCCL_DEPRECATED _CCCL_HOST inline auto capture_as_dependency(unique_eager_event& _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END - -#endif // C++14 diff --git a/thrust/thrust/system/cuda/future.h b/thrust/thrust/system/cuda/future.h index bee0a841ce4..bbaa63566a9 100644 --- a/thrust/thrust/system/cuda/future.h +++ b/thrust/thrust/system/cuda/future.h @@ -15,10 +15,8 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER >= 2014 - -# include -# include +#include +#include THRUST_NAMESPACE_BEGIN @@ -73,6 +71,4 @@ _CCCL_SUPPRESS_DEPRECATED_POP THRUST_NAMESPACE_END -# include - -#endif // C++14 +#include diff --git a/thrust/thrust/type_traits/is_execution_policy.h b/thrust/thrust/type_traits/is_execution_policy.h index 8f61c42eb4d..a97ccebf6d4 100644 --- a/thrust/thrust/type_traits/is_execution_policy.h +++ b/thrust/thrust/type_traits/is_execution_policy.h @@ -50,13 +50,11 @@ THRUST_NAMESPACE_BEGIN template using is_execution_policy = ::cuda::std::is_base_of; -#if _CCCL_STD_VER >= 2014 /*! \brief constexpr bool that is \c true if \c T is an * \a ExecutionPolicy and \c false otherwise. */ template constexpr bool is_execution_policy_v = is_execution_policy::value; -#endif /*! \} // type traits */ diff --git a/thrust/thrust/type_traits/is_operator_less_or_greater_function_object.h b/thrust/thrust/type_traits/is_operator_less_or_greater_function_object.h index 4840948d9e3..e568b4e44bd 100644 --- a/thrust/thrust/type_traits/is_operator_less_or_greater_function_object.h +++ b/thrust/thrust/type_traits/is_operator_less_or_greater_function_object.h @@ -75,7 +75,6 @@ struct is_operator_greater_function_object_impl; template using is_operator_less_function_object = detail::is_operator_less_function_object_impl; -#if _CCCL_STD_VER >= 2014 /*! \brief constexpr bool that is \c true if \c T is a * BinaryPredicate * equivalent to \c operator<, and \c false otherwise. @@ -87,7 +86,6 @@ using is_operator_less_function_object = detail::is_operator_less_function_objec */ template constexpr bool is_operator_less_function_object_v = is_operator_less_function_object::value; -#endif /*! \brief UnaryTypeTrait * that returns \c true_type if \c T is a @@ -102,7 +100,6 @@ constexpr bool is_operator_less_function_object_v = is_operator_less_function_ob template using is_operator_greater_function_object = detail::is_operator_greater_function_object_impl; -#if _CCCL_STD_VER >= 2014 /*! \brief constexpr bool that is \c true if \c T is a * BinaryPredicate * equivalent to \c operator>, and \c false otherwise. @@ -114,7 +111,6 @@ using is_operator_greater_function_object = detail::is_operator_greater_function */ template constexpr bool is_operator_greater_function_object_v = is_operator_greater_function_object::value; -#endif /*! \brief UnaryTypeTrait * that returns \c true_type if \c T is a @@ -132,7 +128,6 @@ using is_operator_less_or_greater_function_object = detail::is_operator_less_function_object_impl::value || detail::is_operator_greater_function_object_impl::value>; -#if _CCCL_STD_VER >= 2014 /*! \brief constexpr bool that is \c true if \c T is a * BinaryPredicate * equivalent to \c operator< or \c operator>, and \c false otherwise. @@ -144,7 +139,6 @@ using is_operator_less_or_greater_function_object = */ template constexpr bool is_operator_less_or_greater_function_object_v = is_operator_less_or_greater_function_object::value; -#endif /////////////////////////////////////////////////////////////////////////////// diff --git a/thrust/thrust/type_traits/is_operator_plus_function_object.h b/thrust/thrust/type_traits/is_operator_plus_function_object.h index 8f446d2a060..914d1fe189a 100644 --- a/thrust/thrust/type_traits/is_operator_plus_function_object.h +++ b/thrust/thrust/type_traits/is_operator_plus_function_object.h @@ -72,7 +72,6 @@ struct is_operator_plus_function_object_impl; template using is_operator_plus_function_object = detail::is_operator_plus_function_object_impl; -#if _CCCL_STD_VER >= 2014 /*! \brief constexpr bool that is \c true if \c T is a * FunctionObject * equivalent to \c operator<, and \c false otherwise. @@ -84,7 +83,6 @@ using is_operator_plus_function_object = detail::is_operator_plus_function_objec */ template constexpr bool is_operator_plus_function_object_v = is_operator_plus_function_object::value; -#endif /////////////////////////////////////////////////////////////////////////////// diff --git a/thrust/thrust/type_traits/is_trivially_relocatable.h b/thrust/thrust/type_traits/is_trivially_relocatable.h index a53b297c438..31eb5d584ce 100644 --- a/thrust/thrust/type_traits/is_trivially_relocatable.h +++ b/thrust/thrust/type_traits/is_trivially_relocatable.h @@ -83,7 +83,6 @@ struct is_trivially_relocatable_impl; template using is_trivially_relocatable = detail::is_trivially_relocatable_impl; -#if _CCCL_STD_VER >= 2014 /*! \brief constexpr bool that is \c true if \c T is * TriviallyRelocatable, * aka can be bitwise copied with a facility like @@ -98,7 +97,6 @@ using is_trivially_relocatable = detail::is_trivially_relocatable_impl; */ template constexpr bool is_trivially_relocatable_v = is_trivially_relocatable::value; -#endif /*! \brief BinaryTypeTrait * that returns \c true_type if \c From is @@ -117,7 +115,6 @@ template using is_trivially_relocatable_to = integral_constant::value && is_trivially_relocatable::value>; -#if _CCCL_STD_VER >= 2014 /*! \brief constexpr bool that is \c true if \c From is * TriviallyRelocatable, * to \c To, aka can be bitwise copied with a facility like @@ -132,7 +129,6 @@ using is_trivially_relocatable_to = */ template constexpr bool is_trivially_relocatable_to_v = is_trivially_relocatable_to::value; -#endif /*! \brief BinaryTypeTrait * that returns \c true_type if the element type of \c FromIterator is @@ -155,7 +151,6 @@ using is_indirectly_trivially_relocatable_to = && is_trivially_relocatable_to::value_type, typename thrust::iterator_traits::value_type>::value>; -#if _CCCL_STD_VER >= 2014 /*! \brief constexpr bool that is \c true if the element type of * \c FromIterator is * TriviallyRelocatable, @@ -173,7 +168,6 @@ using is_indirectly_trivially_relocatable_to = template constexpr bool is_indirectly_trivially_relocate_to_v = is_indirectly_trivially_relocatable_to::value; -#endif /*! \brief customization point * that can be specialized customized to indicate that a type \c T is diff --git a/thrust/thrust/type_traits/logical_metafunctions.h b/thrust/thrust/type_traits/logical_metafunctions.h index 5a05b83c896..a7ea5e05823 100644 --- a/thrust/thrust/type_traits/logical_metafunctions.h +++ b/thrust/thrust/type_traits/logical_metafunctions.h @@ -45,28 +45,22 @@ template using conjunction_value CCCL_DEPRECATED_BECAUSE("Use: cuda::std::bool_constant<(Bs && ...)>") = conjunction<::cuda::std::bool_constant...>; -#if _CCCL_STD_VER >= 2014 template constexpr bool conjunction_value_v CCCL_DEPRECATED_BECAUSE("Use a fold expression: Bs && ...") = conjunction_value::value; -#endif template using disjunction_value CCCL_DEPRECATED_BECAUSE("Use: cuda::std::bool_constant<(Bs || ...)>") = disjunction<::cuda::std::bool_constant...>; -#if _CCCL_STD_VER >= 2014 template constexpr bool disjunction_value_v CCCL_DEPRECATED_BECAUSE("Use a fold expression: Bs || ...") = disjunction_value::value; -#endif template using negation_value CCCL_DEPRECATED_BECAUSE("Use cuda::std::bool_constant") = ::cuda::std::bool_constant; -#if _CCCL_STD_VER >= 2014 template constexpr bool negation_value_v CCCL_DEPRECATED_BECAUSE("Use a plain negation !B") = negation_value::value; -#endif THRUST_NAMESPACE_END diff --git a/thrust/thrust/zip_function.h b/thrust/thrust/zip_function.h index e9bd1bf9848..97bd36b3473 100644 --- a/thrust/thrust/zip_function.h +++ b/thrust/thrust/zip_function.h @@ -40,8 +40,6 @@ namespace zip_detail { // Add workaround for decltype(auto) on C++11-only compilers: -#if _CCCL_STD_VER >= 2014 - _CCCL_EXEC_CHECK_DISABLE template _CCCL_HOST_DEVICE decltype(auto) apply_impl(Function&& func, Tuple&& args, index_sequence) @@ -56,21 +54,6 @@ _CCCL_HOST_DEVICE decltype(auto) apply(Function&& func, Tuple&& args) return apply_impl(THRUST_FWD(func), THRUST_FWD(args), make_index_sequence{}); } -#else // _CCCL_STD_VER - -_CCCL_EXEC_CHECK_DISABLE -template -_CCCL_HOST_DEVICE auto apply_impl(Function&& func, Tuple&& args, index_sequence) - THRUST_DECLTYPE_RETURNS(func(thrust::get(THRUST_FWD(args))...)) - - template - _CCCL_HOST_DEVICE auto apply(Function&& func, Tuple&& args) THRUST_DECLTYPE_RETURNS(apply_impl( - THRUST_FWD(func), - THRUST_FWD(args), - make_index_sequence::type>::value>{})) - -#endif // _CCCL_STD_VER - } // namespace zip_detail } // namespace detail @@ -146,8 +129,7 @@ class zip_function : func(std::move(func)) {} -// Add workaround for decltype(auto) on C++11-only compilers: -#if _CCCL_STD_VER >= 2014 + // Add workaround for decltype(auto) on C++11-only compilers: template _CCCL_HOST_DEVICE decltype(auto) operator()(Tuple&& args) const @@ -155,20 +137,6 @@ class zip_function return detail::zip_detail::apply(func, THRUST_FWD(args)); } -#else // _CCCL_STD_VER - - // Can't just use THRUST_DECLTYPE_RETURNS here since we need to use - // std::declval for the signature components: - template - _CCCL_HOST_DEVICE auto operator()(Tuple&& args) const - noexcept(noexcept(detail::zip_detail::apply(std::declval(), THRUST_FWD(args)))) - -> decltype(detail::zip_detail::apply(std::declval(), THRUST_FWD(args))) - { - return detail::zip_detail::apply(func, THRUST_FWD(args)); - } - -#endif // _CCCL_STD_VER - //! Returns a reference to the underlying function. _CCCL_HOST_DEVICE Function& underlying_function() const {