Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate thrust::null_type #3367

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions thrust/testing/tuple.cu
Original file line number Diff line number Diff line change
@@ -529,6 +529,7 @@ DECLARE_UNITTEST(TestTupleCTAD);
#endif // _CCCL_STD_VER >= 2017

// Ensure that we are backwards compatible with the old thrust::tuple implementation
_CCCL_SUPPRESS_DEPRECATED_PUSH
static_assert(
thrust::tuple_size<thrust::tuple<thrust::null_type,
thrust::null_type,
@@ -625,3 +626,4 @@ static_assert(
static_assert(
thrust::tuple_size<thrust::tuple<int, int, int, int, int, int, int, int, int, thrust::null_type>>::value == 9, "");
static_assert(thrust::tuple_size<thrust::tuple<int, int, int, int, int, int, int, int, int, int>>::value == 10, "");
_CCCL_SUPPRESS_DEPRECATED_POP
8 changes: 7 additions & 1 deletion thrust/thrust/tuple.h
Original file line number Diff line number Diff line change
@@ -44,9 +44,11 @@
THRUST_NAMESPACE_BEGIN

// define null_type for backwards compatibility
struct null_type
struct CCCL_DEPRECATED_BECAUSE("Please remove null_type from parameters to tuple<...>") null_type
{};

_CCCL_SUPPRESS_DEPRECATED_PUSH

_CCCL_HOST_DEVICE inline bool operator==(const null_type&, const null_type&)
{
return true;
@@ -77,6 +79,8 @@ _CCCL_HOST_DEVICE inline bool operator>(const null_type&, const null_type&)
return false;
}

_CCCL_SUPPRESS_DEPRECATED_POP

/*! \addtogroup utility
* \{
*/
@@ -176,6 +180,7 @@ using _CUDA_VSTD::tie;
THRUST_NAMESPACE_END

_LIBCUDACXX_BEGIN_NAMESPACE_STD
_CCCL_SUPPRESS_DEPRECATED_PUSH

template <>
struct tuple_size<tuple<THRUST_NS_QUALIFIER::null_type,
@@ -284,4 +289,5 @@ struct tuple_size<tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, THRUST_NS_QUALIFIER:
: tuple_size<tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8>>
{};

_CCCL_SUPPRESS_DEPRECATED_POP
_LIBCUDACXX_END_NAMESPACE_STD