From 23daaf711a33b9821c1691629787612afea5a877 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Tue, 2 Jul 2024 16:50:21 +0200 Subject: [PATCH] Deprecate more nested aliases --- docs/repo.toml | 2 ++ .../include/cuda/std/__cccl/attributes.h | 7 ++++ thrust/thrust/functional.h | 36 ++++++++++++------- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/docs/repo.toml b/docs/repo.toml index 9ce0bbd0c2..7badcbff89 100644 --- a/docs/repo.toml +++ b/docs/repo.toml @@ -138,6 +138,7 @@ doxygen_aliases = [ # more information on the format can be found at: # https://www.doxygen.nl/manual/config.html#cfg_predefined doxygen_predefined = [ + "_CCCL_ALIAS_ATTRIBUTE(x)=", "_CCCL_HOST", "_CCCL_DEVICE", "_CCCL_HOST_DEVICE", @@ -232,6 +233,7 @@ doxygen_aliases = [] # more information on the format can be found at: # https://www.doxygen.nl/manual/config.html#cfg_predefined doxygen_predefined = [ + "_CCCL_ALIAS_ATTRIBUTE(x)=", "_CCCL_DEVICE=", "_CCCL_EXEC_CHECK_DISABLE=", "_CCCL_FORCEINLINE=", diff --git a/libcudacxx/include/cuda/std/__cccl/attributes.h b/libcudacxx/include/cuda/std/__cccl/attributes.h index dc00e67f30..e76ade4589 100644 --- a/libcudacxx/include/cuda/std/__cccl/attributes.h +++ b/libcudacxx/include/cuda/std/__cccl/attributes.h @@ -76,6 +76,13 @@ # define _CCCL_NODISCARD_FRIEND _CCCL_NODISCARD friend #endif // !_CCCL_CUDACC_BELOW_11_3 && !_CCCL_COMPILER_CLANG +// NVCC below 11.3 does not support attributes on alias declarations +#ifdef _CCCL_CUDACC_BELOW_11_3 +# define _CCCL_ALIAS_ATTRIBUTE(...) +#else // ^^^ _CCCL_CUDACC_BELOW_11_3 ^^^ / vvv !_CCCL_CUDACC_BELOW_11_3 vvv +# define _CCCL_ALIAS_ATTRIBUTE(...) __VA_ARGS__ +#endif // !_CCCL_CUDACC_BELOW_11_3 + #if defined(_CCCL_COMPILER_MSVC) # define _CCCL_NORETURN __declspec(noreturn) #elif __has_cpp_attribute(noreturn) diff --git a/thrust/thrust/functional.h b/thrust/thrust/functional.h index e860c52768..bd4caca83a 100644 --- a/thrust/thrust/functional.h +++ b/thrust/thrust/functional.h @@ -1271,18 +1271,21 @@ struct maximum { /*! \typedef first_argument_type * \brief The type of the function object's first argument. + * deprecated [Since 2.6] */ - using first_argument_type = T; + using first_argument_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T; /*! \typedef second_argument_type * \brief The type of the function object's second argument. + * deprecated [Since 2.6] */ - using second_argument_type = T; + using second_argument_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T; /*! \typedef result_type * \brief The type of the function object's result; + * deprecated [Since 2.6] */ - using result_type = T; + using result_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T; /*! Function call operator. The return value is rhs < lhs ? lhs : rhs. */ @@ -1325,18 +1328,21 @@ struct minimum { /*! \typedef first_argument_type * \brief The type of the function object's first argument. + * deprecated [Since 2.6] */ - using first_argument_type = T; + using first_argument_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T; /*! \typedef second_argument_type * \brief The type of the function object's second argument. + * deprecated [Since 2.6] */ - using second_argument_type = T; + using second_argument_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T; /*! \typedef result_type * \brief The type of the function object's result; + * deprecated [Since 2.6] */ - using result_type = T; + using result_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T; /*! Function call operator. The return value is lhs < rhs ? lhs : rhs. */ @@ -1372,18 +1378,21 @@ struct project1st { /*! \typedef first_argument_type * \brief The type of the function object's first argument. + * deprecated [Since 2.6] */ - using first_argument_type = T1; + using first_argument_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T1; /*! \typedef second_argument_type * \brief The type of the function object's second argument. + * deprecated [Since 2.6] */ - using second_argument_type = T2; + using second_argument_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T2; /*! \typedef result_type * \brief The type of the function object's result; + * deprecated [Since 2.6] */ - using result_type = T1; + using result_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T1; /*! Function call operator. The return value is lhs. */ @@ -1429,18 +1438,21 @@ struct project2nd { /*! \typedef first_argument_type * \brief The type of the function object's first argument. + * deprecated [Since 2.6] */ - using first_argument_type = T1; + using first_argument_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T1; /*! \typedef second_argument_type * \brief The type of the function object's second argument. + * deprecated [Since 2.6] */ - using second_argument_type = T2; + using second_argument_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T2; /*! \typedef result_type * \brief The type of the function object's result; + * deprecated [Since 2.6] */ - using result_type = T2; + using result_type _CCCL_ALIAS_ATTRIBUTE(THRUST_DEPRECATED) = T2; /*! Function call operator. The return value is rhs. */