Skip to content

Commit

Permalink
More suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jan 13, 2025
1 parent c7df289 commit 9c9880d
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 27 deletions.
2 changes: 2 additions & 0 deletions thrust/testing/async/exclusive_scan/mixin.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ struct simple
PostfixArgTuple&& postfix_tuple,
std::index_sequence<PostfixArgIndices...>)
{
_CCCL_SUPPRESS_DEPRECATED_PUSH
auto e = thrust::async::exclusive_scan(
std::get<PrefixArgIndices>(THRUST_FWD(prefix_tuple))...,
input.cbegin(),
input.cend(),
output.begin(),
std::get<PostfixArgIndices>(THRUST_FWD(postfix_tuple))...);
_CCCL_SUPPRESS_DEPRECATED_POP
return e;
}
};
Expand Down
2 changes: 2 additions & 0 deletions thrust/testing/async/inclusive_scan/mixin.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ struct simple
PostfixArgTuple&& postfix_tuple,
std::index_sequence<PostfixArgIndices...>)
{
_CCCL_SUPPRESS_DEPRECATED_PUSH
auto e = thrust::async::inclusive_scan(
std::get<PrefixArgIndices>(THRUST_FWD(prefix_tuple))...,
input.cbegin(),
input.cend(),
output.begin(),
std::get<PostfixArgIndices>(THRUST_FWD(postfix_tuple))...);
_CCCL_SUPPRESS_DEPRECATED_POP
return e;
}
};
Expand Down
2 changes: 1 addition & 1 deletion thrust/thrust/async/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct copy_fn final
Sentinel&& last,
OutputIt&& output)
// ADL dispatch.
THRUST_RETURNS(async_copy(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_copy(
thrust::detail::derived_cast(thrust::detail::strip_const(from_exec)),
thrust::detail::derived_cast(thrust::detail::strip_const(to_exec)),
THRUST_FWD(first),
Expand Down
9 changes: 5 additions & 4 deletions thrust/thrust/async/for_each.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ struct for_each_fn final
Sentinel&& last,
UnaryFunction&& f)
// ADL dispatch.
THRUST_RETURNS(async_for_each(thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
THRUST_FWD(f)))
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_for_each(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
THRUST_FWD(f)))

template <typename ForwardIt, typename Sentinel, typename UnaryFunction>
_CCCL_HOST static auto call(ForwardIt&& first, Sentinel&& last, UnaryFunction&& f)
Expand Down
12 changes: 6 additions & 6 deletions thrust/thrust/async/reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct reduce_fn final
T&& init,
BinaryOp&& op)
// ADL dispatch.
THRUST_RETURNS(async_reduce(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_reduce(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -92,7 +92,7 @@ struct reduce_fn final
T&& init,
thrust::true_type)
// ADL dispatch.
THRUST_RETURNS(async_reduce(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_reduce(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -105,7 +105,7 @@ struct reduce_fn final
Sentinel&& last,
thrust::true_type)
// ADL dispatch.
THRUST_RETURNS(async_reduce(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_reduce(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand Down Expand Up @@ -197,7 +197,7 @@ struct reduce_into_fn final
T&& init,
BinaryOp&& op)
// ADL dispatch.
THRUST_RETURNS(async_reduce_into(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_reduce_into(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -214,7 +214,7 @@ struct reduce_into_fn final
T&& init,
thrust::true_type)
// ADL dispatch.
THRUST_RETURNS(async_reduce_into(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_reduce_into(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -230,7 +230,7 @@ struct reduce_into_fn final
OutputIt&& output,
thrust::true_type)
// ADL dispatch.
THRUST_RETURNS(async_reduce_into(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_reduce_into(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand Down
24 changes: 12 additions & 12 deletions thrust/thrust/async/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct inclusive_scan_fn final
OutputIt&& out,
BinaryOp&& op) const
// ADL dispatch.
THRUST_RETURNS(async_inclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_inclusive_scan(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -106,7 +106,7 @@ struct inclusive_scan_fn final
Sentinel&& last,
OutputIt&& out) const
// ADL dispatch.
THRUST_RETURNS(async_inclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_inclusive_scan(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -127,7 +127,7 @@ struct inclusive_scan_fn final
InitialValueType&& init,
BinaryOp&& op) const
// ADL dispatch.
THRUST_RETURNS(async_inclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_inclusive_scan(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -142,7 +142,7 @@ struct inclusive_scan_fn final
typename = std::enable_if_t<!is_execution_policy_v<remove_cvref_t<ForwardIt>>>>
CCCL_DEPRECATED auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& out, BinaryOp&& op) const
// ADL dispatch.
THRUST_RETURNS(async_inclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_inclusive_scan(
thrust::detail::select_system(iterator_system_t<remove_cvref_t<ForwardIt>>{},
iterator_system_t<remove_cvref_t<OutputIt>>{}),
THRUST_FWD(first),
Expand All @@ -153,7 +153,7 @@ struct inclusive_scan_fn final
template <typename ForwardIt, typename Sentinel, typename OutputIt>
CCCL_DEPRECATED auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& out) const
// ADL dispatch.
THRUST_RETURNS(async_inclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_inclusive_scan(
thrust::detail::select_system(iterator_system_t<remove_cvref_t<ForwardIt>>{},
iterator_system_t<remove_cvref_t<OutputIt>>{}),
THRUST_FWD(first),
Expand All @@ -170,7 +170,7 @@ struct inclusive_scan_fn final
CCCL_DEPRECATED
auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& out, InitialValueType&& init, BinaryOp&& op) const
// ADL dispatch.
THRUST_RETURNS(async_inclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_inclusive_scan(
thrust::detail::select_system(iterator_system_t<remove_cvref_t<ForwardIt>>{},
iterator_system_t<remove_cvref_t<OutputIt>>{}),
THRUST_FWD(first),
Expand Down Expand Up @@ -210,7 +210,7 @@ struct exclusive_scan_fn final
InitialValueType&& init,
BinaryOp&& op) const
// ADL dispatch.
THRUST_RETURNS(async_exclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_exclusive_scan(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -226,7 +226,7 @@ struct exclusive_scan_fn final
OutputIt&& out,
InitialValueType&& init) const
// ADL dispatch.
THRUST_RETURNS(async_exclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_exclusive_scan(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -241,7 +241,7 @@ struct exclusive_scan_fn final
Sentinel&& last,
OutputIt&& out) const
// ADL dispatch.
THRUST_RETURNS(async_exclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_exclusive_scan(
thrust::detail::derived_cast(thrust::detail::strip_const(exec)),
THRUST_FWD(first),
THRUST_FWD(last),
Expand All @@ -258,7 +258,7 @@ struct exclusive_scan_fn final
CCCL_DEPRECATED
auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& out, InitialValueType&& init, BinaryOp&& op) const
// ADL dispatch.
THRUST_RETURNS(async_exclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_exclusive_scan(
thrust::detail::select_system(iterator_system_t<remove_cvref_t<ForwardIt>>{},
iterator_system_t<remove_cvref_t<OutputIt>>{}),
THRUST_FWD(first),
Expand All @@ -274,7 +274,7 @@ struct exclusive_scan_fn final
typename = std::enable_if_t<!is_execution_policy_v<remove_cvref_t<ForwardIt>>>>
CCCL_DEPRECATED auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& out, InitialValueType&& init) const
// ADL dispatch.
THRUST_RETURNS(async_exclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_exclusive_scan(
thrust::detail::select_system(iterator_system_t<remove_cvref_t<ForwardIt>>{},
iterator_system_t<remove_cvref_t<OutputIt>>{}),
THRUST_FWD(first),
Expand All @@ -286,7 +286,7 @@ struct exclusive_scan_fn final
template <typename ForwardIt, typename Sentinel, typename OutputIt>
CCCL_DEPRECATED auto operator()(ForwardIt&& first, Sentinel&& last, OutputIt&& out) const
// ADL dispatch.
THRUST_RETURNS(async_exclusive_scan(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(async_exclusive_scan(
thrust::detail::select_system(iterator_system_t<remove_cvref_t<ForwardIt>>{},
iterator_system_t<remove_cvref_t<OutputIt>>{}),
THRUST_FWD(first),
Expand Down
6 changes: 3 additions & 3 deletions thrust/thrust/async/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct stable_sort_fn final
, StrictWeakOrdering&& comp
)
// ADL dispatch.
THRUST_RETURNS(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(
async_stable_sort(
thrust::detail::derived_cast(thrust::detail::strip_const(exec))
, THRUST_FWD(first), THRUST_FWD(last)
Expand All @@ -99,7 +99,7 @@ struct stable_sort_fn final
, ForwardIt&& first, Sentinel&& last
)
// ADL dispatch.
THRUST_RETURNS(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(
async_stable_sort(
thrust::detail::derived_cast(thrust::detail::strip_const(exec))
, THRUST_FWD(first), THRUST_FWD(last)
Expand Down Expand Up @@ -181,7 +181,7 @@ struct sort_fn final
, StrictWeakOrdering&& comp
)
// ADL dispatch.
THRUST_RETURNS(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(
async_sort(
thrust::detail::derived_cast(thrust::detail::strip_const(exec))
, THRUST_FWD(first), THRUST_FWD(last)
Expand Down
2 changes: 1 addition & 1 deletion thrust/thrust/async/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ struct transform_fn final
, UnaryOperation&& op
)
// ADL dispatch.
THRUST_RETURNS(
_THRUST_RETURNS_SUPPRESS_DEPRECATIONS(
async_transform(
thrust::detail::derived_cast(thrust::detail::strip_const(exec))
, THRUST_FWD(first), THRUST_FWD(last)
Expand Down
8 changes: 8 additions & 0 deletions thrust/thrust/detail/type_deduction.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@
} \
/**/

#define _THRUST_RETURNS_SUPPRESS_DEPRECATIONS(...) \
noexcept(noexcept(__VA_ARGS__)) \
{ \
_CCCL_SUPPRESS_DEPRECATED_PUSH \
return (__VA_ARGS__); \
_CCCL_SUPPRESS_DEPRECATED_POP \
}

/// \def THRUST_DECLTYPE_RETURNS(...)
/// \brief Expands to a function definition, including a trailing returning
/// type, that returns the expression \c __VA_ARGS__.
Expand Down

0 comments on commit 9c9880d

Please sign in to comment.