Skip to content

Commit

Permalink
Deprecate thrust::async
Browse files Browse the repository at this point in the history
Fixes: #100
  • Loading branch information
bernhardmgruber committed Jan 10, 2025
1 parent 6c3cbb6 commit 80832ae
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 19 deletions.
2 changes: 2 additions & 0 deletions thrust/testing/async_copy.cu
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# include <unittest/unittest.h>
# include <unittest/util_async.h>

_CCCL_SUPPRESS_DEPRECATED_PUSH

# define DEFINE_ASYNC_COPY_CALLABLE(name, ...) \
struct THRUST_PP_CAT2(name, _fn) \
{ \
Expand Down
3 changes: 2 additions & 1 deletion thrust/testing/async_for_each.cu
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

# include <unittest/unittest.h>

_CCCL_SUPPRESS_DEPRECATED_PUSH

# define DEFINE_ASYNC_FOR_EACH_CALLABLE(name, ...) \
struct THRUST_PP_CAT2(name, _fn) \
{ \
Expand All @@ -21,7 +23,6 @@
/**/

DEFINE_ASYNC_FOR_EACH_CALLABLE(invoke_async_for_each);

DEFINE_ASYNC_FOR_EACH_CALLABLE(invoke_async_for_each_device, thrust::device);

# undef DEFINE_ASYNC_FOR_EACH_CALLABLE
Expand Down
2 changes: 2 additions & 0 deletions thrust/testing/async_reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# include <unittest/unittest.h>
# include <unittest/util_async.h>

_CCCL_SUPPRESS_DEPRECATED_PUSH

template <typename T>
struct custom_plus
{
Expand Down
2 changes: 2 additions & 0 deletions thrust/testing/async_reduce_into.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# include <unittest/unittest.h>
# include <unittest/util_async.h>

_CCCL_SUPPRESS_DEPRECATED_PUSH

template <typename T>
struct custom_plus
{
Expand Down
2 changes: 2 additions & 0 deletions thrust/testing/async_sort.cu
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

# include <unittest/unittest.h>

_CCCL_SUPPRESS_DEPRECATED_PUSH

enum wait_policy
{
wait_for_futures,
Expand Down
2 changes: 2 additions & 0 deletions thrust/testing/async_transform.cu
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# include <unittest/unittest.h>
# include <unittest/util_async.h>

_CCCL_SUPPRESS_DEPRECATED_PUSH

template <typename T>
struct divide_by_2
{
Expand Down
4 changes: 2 additions & 2 deletions thrust/thrust/async/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace unimplemented
{

template <typename FromPolicy, typename ToPolicy, typename ForwardIt, typename Sentinel, typename OutputIt>
_CCCL_HOST event<FromPolicy> async_copy(
CCCL_DEPRECATED _CCCL_HOST event<FromPolicy> async_copy(
thrust::execution_policy<FromPolicy>& from_exec,
thrust::execution_policy<ToPolicy>& to_exec,
ForwardIt first,
Expand Down Expand Up @@ -116,7 +116,7 @@ struct copy_fn final

} // namespace copy_detail

_CCCL_GLOBAL_CONSTANT copy_detail::copy_fn copy{};
CCCL_DEPRECATED _CCCL_GLOBAL_CONSTANT copy_detail::copy_fn copy{};

/*! \endcond
*/
Expand Down
4 changes: 2 additions & 2 deletions thrust/thrust/async/for_each.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace unimplemented
{

template <typename DerivedPolicy, typename ForwardIt, typename Sentinel, typename UnaryFunction>
_CCCL_HOST event<DerivedPolicy>
CCCL_DEPRECATED _CCCL_HOST event<DerivedPolicy>
async_for_each(thrust::execution_policy<DerivedPolicy>&, ForwardIt, Sentinel, UnaryFunction)
{
THRUST_STATIC_ASSERT_MSG((thrust::detail::depend_on_instantiation<ForwardIt, false>::value),
Expand Down Expand Up @@ -93,7 +93,7 @@ struct for_each_fn final

} // namespace for_each_detail

_CCCL_GLOBAL_CONSTANT for_each_detail::for_each_fn for_each{};
CCCL_DEPRECATED _CCCL_GLOBAL_CONSTANT for_each_detail::for_each_fn for_each{};

/*! \endcond
*/
Expand Down
8 changes: 4 additions & 4 deletions thrust/thrust/async/reduce.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace unimplemented
{

template <typename DerivedPolicy, typename ForwardIt, typename Sentinel, typename T, typename BinaryOp>
_CCCL_HOST future<DerivedPolicy, T>
CCCL_DEPRECATED _CCCL_HOST future<DerivedPolicy, T>
async_reduce(thrust::execution_policy<DerivedPolicy>&, ForwardIt, Sentinel, T, BinaryOp)
{
THRUST_STATIC_ASSERT_MSG((thrust::detail::depend_on_instantiation<ForwardIt, false>::value),
Expand Down Expand Up @@ -159,15 +159,15 @@ struct reduce_fn final

} // namespace reduce_detail

_CCCL_GLOBAL_CONSTANT reduce_detail::reduce_fn reduce{};
CCCL_DEPRECATED _CCCL_GLOBAL_CONSTANT reduce_detail::reduce_fn reduce{};

///////////////////////////////////////////////////////////////////////////////

namespace unimplemented
{

template <typename DerivedPolicy, typename ForwardIt, typename Sentinel, typename OutputIt, typename T, typename BinaryOp>
_CCCL_HOST event<DerivedPolicy>
CCCL_DEPRECATED _CCCL_HOST event<DerivedPolicy>
async_reduce_into(thrust::execution_policy<DerivedPolicy>&, ForwardIt, Sentinel, OutputIt, T, BinaryOp)
{
THRUST_STATIC_ASSERT_MSG((thrust::detail::depend_on_instantiation<ForwardIt, false>::value),
Expand Down Expand Up @@ -295,7 +295,7 @@ struct reduce_into_fn final

} // namespace reduce_into_detail

_CCCL_GLOBAL_CONSTANT reduce_into_detail::reduce_into_fn reduce_into{};
CCCL_DEPRECATED _CCCL_GLOBAL_CONSTANT reduce_into_detail::reduce_into_fn reduce_into{};

/*! \endcond
*/
Expand Down
8 changes: 4 additions & 4 deletions thrust/thrust/async/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace unimplemented
{

template <typename DerivedPolicy, typename ForwardIt, typename Sentinel, typename OutputIt, typename BinaryOp>
event<DerivedPolicy>
CCCL_DEPRECATED event<DerivedPolicy>
async_inclusive_scan(thrust::execution_policy<DerivedPolicy>&, ForwardIt, Sentinel, OutputIt, BinaryOp)
{
THRUST_STATIC_ASSERT_MSG((thrust::detail::depend_on_instantiation<ForwardIt, false>::value),
Expand All @@ -65,7 +65,7 @@ template <typename DerivedPolicy,
typename OutputIt,
typename InitialValueType,
typename BinaryOp>
event<DerivedPolicy> async_exclusive_scan(
CCCL_DEPRECATED event<DerivedPolicy> async_exclusive_scan(
thrust::execution_policy<DerivedPolicy>&, ForwardIt, Sentinel, OutputIt, InitialValueType, BinaryOp)
{
THRUST_STATIC_ASSERT_MSG((thrust::detail::depend_on_instantiation<ForwardIt, false>::value),
Expand Down Expand Up @@ -178,7 +178,7 @@ struct inclusive_scan_fn final

} // namespace inclusive_scan_detail

_CCCL_GLOBAL_CONSTANT inclusive_scan_detail::inclusive_scan_fn inclusive_scan{};
CCCL_DEPRECATED _CCCL_GLOBAL_CONSTANT inclusive_scan_detail::inclusive_scan_fn inclusive_scan{};

namespace exclusive_scan_detail
{
Expand Down Expand Up @@ -287,7 +287,7 @@ struct exclusive_scan_fn final

} // namespace exclusive_scan_detail

_CCCL_GLOBAL_CONSTANT exclusive_scan_detail::exclusive_scan_fn exclusive_scan{};
CCCL_DEPRECATED _CCCL_GLOBAL_CONSTANT exclusive_scan_detail::exclusive_scan_fn exclusive_scan{};

} // namespace async

Expand Down
8 changes: 4 additions & 4 deletions thrust/thrust/async/sort.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace unimplemented
{

template <typename DerivedPolicy, typename ForwardIt, typename Sentinel, typename StrictWeakOrdering>
_CCCL_HOST event<DerivedPolicy>
CCCL_DEPRECATED _CCCL_HOST event<DerivedPolicy>
async_stable_sort(thrust::execution_policy<DerivedPolicy>&, ForwardIt, Sentinel, StrictWeakOrdering)
{
THRUST_STATIC_ASSERT_MSG((thrust::detail::depend_on_instantiation<ForwardIt, false>::value),
Expand Down Expand Up @@ -145,13 +145,13 @@ struct stable_sort_fn final

} // namespace stable_sort_detail

_CCCL_GLOBAL_CONSTANT stable_sort_detail::stable_sort_fn stable_sort{};
CCCL_DEPRECATED _CCCL_GLOBAL_CONSTANT stable_sort_detail::stable_sort_fn stable_sort{};

namespace fallback
{

template <typename DerivedPolicy, typename ForwardIt, typename Sentinel, typename StrictWeakOrdering>
_CCCL_HOST event<DerivedPolicy>
CCCL_DEPRECATED _CCCL_HOST event<DerivedPolicy>
async_sort(thrust::execution_policy<DerivedPolicy>& exec, ForwardIt&& first, Sentinel&& last, StrictWeakOrdering&& comp)
{
return async_stable_sort(thrust::detail::derived_cast(exec), THRUST_FWD(first), THRUST_FWD(last), THRUST_FWD(comp));
Expand Down Expand Up @@ -258,7 +258,7 @@ struct sort_fn final

} // namespace sort_detail

_CCCL_GLOBAL_CONSTANT sort_detail::sort_fn sort{};
CCCL_DEPRECATED _CCCL_GLOBAL_CONSTANT sort_detail::sort_fn sort{};

/*! \endcond
*/
Expand Down
4 changes: 2 additions & 2 deletions thrust/thrust/async/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace unimplemented
{

template <typename DerivedPolicy, typename ForwardIt, typename Sentinel, typename OutputIt, typename UnaryOperation>
_CCCL_HOST event<DerivedPolicy> async_transform(
CCCL_DEPRECATED _CCCL_HOST event<DerivedPolicy> async_transform(
thrust::execution_policy<DerivedPolicy>& exec, ForwardIt first, Sentinel last, OutputIt output, UnaryOperation op)
{
THRUST_STATIC_ASSERT_MSG((thrust::detail::depend_on_instantiation<ForwardIt, false>::value),
Expand Down Expand Up @@ -124,7 +124,7 @@ struct transform_fn final

} // namespace transform_detail

_CCCL_GLOBAL_CONSTANT transform_detail::transform_fn transform{};
CCCL_DEPRECATED _CCCL_GLOBAL_CONSTANT transform_detail::transform_fn transform{};

/*! \endcond
*/
Expand Down

0 comments on commit 80832ae

Please sign in to comment.