Skip to content

Commit

Permalink
Deprecate more nested aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jul 3, 2024
1 parent 7f2c1d1 commit 23daaf7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
2 changes: 2 additions & 0 deletions docs/repo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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=",
Expand Down
7 changes: 7 additions & 0 deletions libcudacxx/include/cuda/std/__cccl/attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
36 changes: 24 additions & 12 deletions thrust/thrust/functional.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tt>rhs < lhs ? lhs : rhs</tt>.
*/
Expand Down Expand Up @@ -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 <tt>lhs < rhs ? lhs : rhs</tt>.
*/
Expand Down Expand Up @@ -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 <tt>lhs</tt>.
*/
Expand Down Expand Up @@ -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 <tt>rhs</tt>.
*/
Expand Down

0 comments on commit 23daaf7

Please sign in to comment.