diff --git a/thrust/thrust/functional.h b/thrust/thrust/functional.h index 16c464f702e..1f4d37eb8d9 100644 --- a/thrust/thrust/functional.h +++ b/thrust/thrust/functional.h @@ -94,13 +94,7 @@ THRUST_NAMESPACE_BEGIN * * \see https://en.cppreference.com/w/cpp/utility/functional/plus */ -template -struct plus : public ::cuda::std::plus -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end plus +using ::cuda::std::plus; /*! \p minus is a function object. Specifically, it is an Adaptable Binary Function. * If \c f is an object of class minus, and \c x and \c y are objects @@ -135,13 +129,7 @@ struct plus : public ::cuda::std::plus * * \see https://en.cppreference.com/w/cpp/utility/functional/minus */ -template -struct minus : public ::cuda::std::minus -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end minus +using ::cuda::std::minus; /*! \p multiplies is a function object. Specifically, it is an Adaptable Binary Function. * If \c f is an object of class multiplies, and \c x and \c y are objects @@ -176,13 +164,7 @@ struct minus : public ::cuda::std::minus * * \see https://en.cppreference.com/w/cpp/utility/functional/multiplies */ -template -struct multiplies : public ::cuda::std::multiplies -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end multiplies +using ::cuda::std::multiplies; /*! \p divides is a function object. Specifically, it is an Adaptable Binary Function. * If \c f is an object of class divides, and \c x and \c y are objects @@ -217,13 +199,7 @@ struct multiplies : public ::cuda::std::multiplies * * \see https://en.cppreference.com/w/cpp/utility/functional/divides */ -template -struct divides : public ::cuda::std::divides -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end divides +using ::cuda::std::divides; /*! \p modulus is a function object. Specifically, it is an Adaptable Binary Function. * If \c f is an object of class modulus, and \c x and \c y are objects @@ -258,13 +234,7 @@ struct divides : public ::cuda::std::divides * * \see https://en.cppreference.com/w/cpp/utility/functional/modulus */ -template -struct modulus : public ::cuda::std::modulus -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end modulus +using ::cuda::std::modulus; /*! \p negate is a function object. Specifically, it is an Adaptable Unary Function. * If \c f is an object of class negate, and \c x is an object @@ -296,12 +266,7 @@ struct modulus : public ::cuda::std::modulus * * \see https://en.cppreference.com/w/cpp/utility/functional/negate */ -template -struct negate : ::cuda::std::negate -{ - using argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end negate +using ::cuda::std::negate; /*! \p square is a function object. Specifically, it is an Adaptable Unary Function. * If \c f is an object of class square, and \c x is an object @@ -334,15 +299,12 @@ struct negate : ::cuda::std::negate template struct square { - using argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - _CCCL_EXEC_CHECK_DISABLE _CCCL_HOST_DEVICE constexpr T operator()(const T& x) const { return x * x; } -}; // end square +}; template <> struct square @@ -376,13 +338,7 @@ struct square * * \see https://en.cppreference.com/w/cpp/utility/functional/equal_to */ -template -struct equal_to : public ::cuda::std::equal_to -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end equal_to +using ::cuda::std::equal_to; /*! \p not_equal_to is a function object. Specifically, it is an Adaptable Binary * Predicate, which means it is a function object that tests the truth or falsehood @@ -395,13 +351,7 @@ struct equal_to : public ::cuda::std::equal_to * * \see https://en.cppreference.com/w/cpp/utility/functional/not_equal_to */ -template -struct not_equal_to : public ::cuda::std::not_equal_to -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end not_equal_to +using ::cuda::std::not_equal_to; /*! \p greater is a function object. Specifically, it is an Adaptable Binary * Predicate, which means it is a function object that tests the truth or falsehood @@ -414,13 +364,7 @@ struct not_equal_to : public ::cuda::std::not_equal_to * * \see https://en.cppreference.com/w/cpp/utility/functional/greater */ -template -struct greater : public ::cuda::std::greater -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end greater +using ::cuda::std::greater; /*! \p less is a function object. Specifically, it is an Adaptable Binary * Predicate, which means it is a function object that tests the truth or falsehood @@ -433,13 +377,7 @@ struct greater : public ::cuda::std::greater * * \see https://en.cppreference.com/w/cpp/utility/functional/less */ -template -struct less : public ::cuda::std::less -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end less +using ::cuda::std::less; /*! \p greater_equal is a function object. Specifically, it is an Adaptable Binary * Predicate, which means it is a function object that tests the truth or falsehood @@ -452,13 +390,7 @@ struct less : public ::cuda::std::less * * \see https://en.cppreference.com/w/cpp/utility/functional/greater_equal */ -template -struct greater_equal : public ::cuda::std::greater_equal -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end greater_equal +using ::cuda::std::greater_equal; /*! \p less_equal is a function object. Specifically, it is an Adaptable Binary * Predicate, which means it is a function object that tests the truth or falsehood @@ -471,13 +403,7 @@ struct greater_equal : public ::cuda::std::greater_equal * * \see https://en.cppreference.com/w/cpp/utility/functional/less_equal */ -template -struct less_equal : public ::cuda::std::less_equal -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end less_equal +using ::cuda::std::less_equal; /*! \} */ @@ -497,13 +423,7 @@ struct less_equal : public ::cuda::std::less_equal * * \see https://en.cppreference.com/w/cpp/utility/functional/logical_and */ -template -struct logical_and : public ::cuda::std::logical_and -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end logical_and +using ::cuda::std::logical_and; /*! \p logical_or is a function object. Specifically, it is an Adaptable Binary Predicate, * which means it is a function object that tests the truth or falsehood of some condition. @@ -515,13 +435,7 @@ struct logical_and : public ::cuda::std::logical_and * * \see https://en.cppreference.com/w/cpp/utility/functional/logical_or */ -template -struct logical_or : public ::cuda::std::logical_or -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end logical_or +using ::cuda::std::logical_or; /*! \p logical_not is a function object. Specifically, it is an Adaptable Predicate, * which means it is a function object that tests the truth or falsehood of some condition. @@ -547,13 +461,7 @@ struct logical_or : public ::cuda::std::logical_or * * \see https://en.cppreference.com/w/cpp/utility/functional/logical_not */ -template -struct logical_not : public ::cuda::std::logical_not -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end logical_not +using ::cuda::std::logical_not; /*! \} */ @@ -594,13 +502,7 @@ struct logical_not : public ::cuda::std::logical_not * // V3 is now {1&13, 2&13, 3&13, ..., 1000%13} * \endcode */ -template -struct bit_and : public ::cuda::std::bit_and -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end bit_and +using ::cuda::std::bit_and; /*! \p bit_or is a function object. Specifically, it is an Adaptable Binary Function. * If \c f is an object of class bit_and, and \c x and \c y are objects @@ -633,13 +535,7 @@ struct bit_and : public ::cuda::std::bit_and * // V3 is now {1|13, 2|13, 3|13, ..., 1000|13} * \endcode */ -template -struct bit_or : public ::cuda::std::bit_or -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end bit_or +using ::cuda::std::bit_or; /*! \p bit_xor is a function object. Specifically, it is an Adaptable Binary Function. * If \c f is an object of class bit_and, and \c x and \c y are objects @@ -672,13 +568,7 @@ struct bit_or : public ::cuda::std::bit_or * // V3 is now {1^13, 2^13, 3^13, ..., 1000^13} * \endcode */ -template -struct bit_xor : public ::cuda::std::bit_xor -{ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end bit_xor +using ::cuda::std::bit_xor; /*! \} */ @@ -711,9 +601,6 @@ struct bit_xor : public ::cuda::std::bit_xor template struct identity { - using argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - _CCCL_EXEC_CHECK_DISABLE _CCCL_HOST_DEVICE constexpr const T& operator()(const T& x) const { @@ -764,27 +651,7 @@ struct identity : ::cuda::std::__identity * \see minimum * \see min */ -template -struct maximum : ::cuda::maximum -{ - /*! \typedef first_argument_type - * \brief The type of the function object's first argument. - * deprecated [Since 2.6] - */ - using first_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - - /*! \typedef second_argument_type - * \brief The type of the function object's second argument. - * deprecated [Since 2.6] - */ - using second_argument_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; - - /*! \typedef result_type - * \brief The type of the function object's result; - * deprecated [Since 2.6] - */ - using result_type _LIBCUDACXX_DEPRECATED_IN_CXX11 = T; -}; // end maximum +using ::cuda::maximum; /*! \p minimum is a function object that takes two arguments and returns the lesser * of the two. Specifically, it is an Adaptable Binary Function. If \c f is an @@ -810,27 +677,7 @@ struct maximum : ::cuda::maximum * \see maximum * \see max */ -template -struct minimum : ::cuda::minimum -{ - /*! \typedef first_argument_type - * \brief The type of the function object's first argument. - * deprecated [Since 2.6] - */ - using first_argument_type _CCCL_ALIAS_ATTRIBUTE(CCCL_DEPRECATED) = T; - - /*! \typedef second_argument_type - * \brief The type of the function object's second argument. - * deprecated [Since 2.6] - */ - using second_argument_type _CCCL_ALIAS_ATTRIBUTE(CCCL_DEPRECATED) = T; - - /*! \typedef result_type - * \brief The type of the function object's result; - * deprecated [Since 2.6] - */ - using result_type _CCCL_ALIAS_ATTRIBUTE(CCCL_DEPRECATED) = T; -}; // end minimum +using ::cuda::minimum; /*! \p project1st is a function object that takes two arguments and returns * its first argument; the second argument is unused. It is essentially a @@ -852,31 +699,13 @@ struct minimum : ::cuda::minimum template struct project1st { - /*! \typedef first_argument_type - * \brief The type of the function object's first argument. - * deprecated [Since 2.6] - */ - using first_argument_type _CCCL_ALIAS_ATTRIBUTE(CCCL_DEPRECATED) = T1; - - /*! \typedef second_argument_type - * \brief The type of the function object's second argument. - * deprecated [Since 2.6] - */ - using second_argument_type _CCCL_ALIAS_ATTRIBUTE(CCCL_DEPRECATED) = T2; - - /*! \typedef result_type - * \brief The type of the function object's result; - * deprecated [Since 2.6] - */ - using result_type _CCCL_ALIAS_ATTRIBUTE(CCCL_DEPRECATED) = T1; - /*! Function call operator. The return value is lhs. */ _CCCL_HOST_DEVICE constexpr const T1& operator()(const T1& lhs, const T2& /*rhs*/) const { return lhs; } -}; // end project1st +}; template <> struct project1st @@ -911,24 +740,6 @@ struct project1st template struct project2nd { - /*! \typedef first_argument_type - * \brief The type of the function object's first argument. - * deprecated [Since 2.6] - */ - using first_argument_type _CCCL_ALIAS_ATTRIBUTE(CCCL_DEPRECATED) = T1; - - /*! \typedef second_argument_type - * \brief The type of the function object's second argument. - * deprecated [Since 2.6] - */ - using second_argument_type _CCCL_ALIAS_ATTRIBUTE(CCCL_DEPRECATED) = T2; - - /*! \typedef result_type - * \brief The type of the function object's result; - * deprecated [Since 2.6] - */ - using result_type _CCCL_ALIAS_ATTRIBUTE(CCCL_DEPRECATED) = T2; - /*! Function call operator. The return value is rhs. */ _CCCL_HOST_DEVICE constexpr const T2& operator()(const T1& /*lhs*/, const T2& rhs) const @@ -959,37 +770,7 @@ struct project2nd * \{ */ -namespace detail -{ -template -struct not_fun_t -{ - F f; - - template - _CCCL_HOST_DEVICE auto - operator()(Ts&&... args) noexcept(noexcept(!f(std::forward(args)...))) -> decltype(!f(std::forward(args)...)) - { - return !f(std::forward(args)...); - } - - template - _CCCL_HOST_DEVICE auto operator()(Ts&&... args) const - noexcept(noexcept(!f(std::forward(args)...))) -> decltype(!f(std::forward(args)...)) - { - return !f(std::forward(args)...); - } -}; -} // namespace detail - -//! Takes a predicate (a callable returning bool) and returns a new predicate that returns the negated result. -//! \see https://en.cppreference.com/w/cpp/utility/functional/not_fn -// TODO(bgruber): alias to ::cuda::std::not_fn in C++17 -template -_CCCL_HOST_DEVICE auto not_fn(F&& f) -> detail::not_fun_t<::cuda::std::decay_t> -{ - return detail::not_fun_t<::cuda::std::decay_t>{std::forward(f)}; -} +using ::cuda::std::not_fn; /*! \} */ @@ -1093,29 +874,5 @@ THRUST_INLINE_CONSTANT thrust::detail::functional::placeholder<9>::type _10; THRUST_NAMESPACE_END -#ifndef _CCCL_DOXYGEN_INVOKED // Do not document -_LIBCUDACXX_BEGIN_NAMESPACE_CUDA -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::plus); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::minus); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::multiplies); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::divides); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::modulus); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::negate); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::bit_and); -//_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::bit_not); // does not exist? -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::bit_or); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::bit_xor); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::equal_to); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::not_equal_to); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::less); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::less_equal); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::greater_equal); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::greater); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::logical_and); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::logical_not); -_LIBCUDACXX_MARK_CAN_COPY_ARGUMENTS(THRUST_NS_QUALIFIER::logical_or); -_LIBCUDACXX_END_NAMESPACE_CUDA -#endif // _CCCL_DOXYGEN_INVOKED - #include #include