Skip to content

Commit

Permalink
Deprecate thrust event, future and more (#3457)
Browse files Browse the repository at this point in the history
Deprecate:
* detail::dependencies_aware_execution_policy
* detail::execute_with_allocator_and_dependencies
* detail::execute_with_dependencies
* [device_]unique_eager_event
* [device_]event
* [device_]unique_eager_future
* [device_]future
* new_stream[_t]
* when_all

And many utility entities around those
  • Loading branch information
bernhardmgruber committed Jan 23, 2025
1 parent a15a057 commit ffc5f6d
Show file tree
Hide file tree
Showing 46 changed files with 291 additions and 110 deletions.
7 changes: 7 additions & 0 deletions thrust/testing/allocator_aware_policies.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include <cuda/__cccl_config>

// need to suppress deprecation warnings for execute_with_allocator_and_dependencies here and inside type traits
_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/seq.h>
#include <thrust/system/cpp/detail/par.h>
#include <thrust/system/omp/detail/par.h>
Expand Down Expand Up @@ -118,3 +123,5 @@ SimpleUnitTest<TestAllocatorAttachment,
omp_par_info,
tbb_par_info>>
TestAllocatorAttachmentInstance;

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/exclusive_scan/counting_iterator.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -40,3 +44,5 @@ struct test_counting_iterator
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_counting_iterator, UnsignedIntegralTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/exclusive_scan/discard_output.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -37,3 +41,5 @@ struct test_discard
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_discard, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/exclusive_scan/large_indices.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -237,3 +241,5 @@ void test_large_indices_custom_scan_op()
DECLARE_UNITTEST(test_large_indices_custom_scan_op);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/exclusive_scan/large_types.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -52,3 +56,5 @@ struct test_large_types
DECLARE_UNITTEST(test_large_types);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/exclusive_scan/mixed_types.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -115,3 +119,5 @@ void test_scan_mixed_types(size_t num_values)
DECLARE_SIZED_UNITTEST(test_scan_mixed_types);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/exclusive_scan/simple.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -65,3 +69,5 @@ struct test_simple_in_place
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_simple_in_place, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/exclusive_scan/stateful_operator.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -62,3 +66,5 @@ struct test_stateful_operator
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_stateful_operator, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/exclusive_scan/using_vs_adl.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -168,3 +172,5 @@ void test_using_cpo()
DECLARE_UNITTEST(test_using_cpo);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/inclusive_scan/counting_iterator.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -39,3 +43,5 @@ struct test_counting_iterator
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_counting_iterator, UnsignedIntegralTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/inclusive_scan/discard_output.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -35,3 +39,5 @@ struct test_discard
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_discard, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/inclusive_scan/large_indices.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -232,3 +236,5 @@ void test_large_indices_custom_scan_op()
DECLARE_UNITTEST(test_large_indices_custom_scan_op);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/inclusive_scan/large_types.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -52,3 +56,5 @@ struct test_large_types
DECLARE_UNITTEST(test_large_types);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/inclusive_scan/mixed_types.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -106,3 +110,5 @@ void test_scan_mixed_types(size_t num_values)
DECLARE_SIZED_UNITTEST(test_scan_mixed_types);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/inclusive_scan/simple.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -90,3 +94,5 @@ struct test_simple_in_place
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_simple_in_place, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/inclusive_scan/stateful_operator.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -62,3 +66,5 @@ struct test_stateful_operator
DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_stateful_operator, NumericTypes);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
6 changes: 6 additions & 0 deletions thrust/testing/async/inclusive_scan/using_vs_adl.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <cuda/__cccl_config>

_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand Down Expand Up @@ -166,3 +170,5 @@ void test_using_cpo()
DECLARE_UNITTEST(test_using_cpo);

#endif // C++14

_CCCL_SUPPRESS_DEPRECATED_POP
9 changes: 7 additions & 2 deletions thrust/testing/async_copy.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include <cuda/__cccl_config>

// need to suppress deprecation warnings inside a lot of thrust headers
_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand All @@ -10,8 +15,6 @@
# 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 Expand Up @@ -321,3 +324,5 @@ DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES(test_async_copy_after, BuiltinNumericT
// Can't do this today because we can't do cross-system with explicit policies.

#endif

_CCCL_SUPPRESS_DEPRECATED_POP
13 changes: 7 additions & 6 deletions thrust/testing/async_reduce.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#define THRUST_ENABLE_FUTURE_RAW_DATA_MEMBER

#include <cuda/__cccl_config>

// need to suppress deprecation warnings inside several thrust headers
_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#if _CCCL_STD_VER >= 2014
Expand All @@ -12,8 +17,6 @@
# include <unittest/unittest.h>
# include <unittest/util_async.h>

_CCCL_SUPPRESS_DEPRECATED_PUSH

template <typename T>
struct custom_plus
{
Expand Down Expand Up @@ -541,16 +544,12 @@ struct test_async_reduce_using
// When you import the customization points into the global namespace,
// they should be selected instead of the synchronous algorithms.
{
_CCCL_SUPPRESS_DEPRECATED_PUSH
using namespace thrust::async;
f0a = reduce(d0a.begin(), d0a.end());
_CCCL_SUPPRESS_DEPRECATED_POP
}
{
_CCCL_SUPPRESS_DEPRECATED_PUSH
using thrust::async::reduce;
f0b = reduce(d0b.begin(), d0b.end());
_CCCL_SUPPRESS_DEPRECATED_POP
}

// ADL should find the synchronous algorithms.
Expand Down Expand Up @@ -884,3 +883,5 @@ struct test_async_reduce_bug1886
DECLARE_UNITTEST(test_async_reduce_bug1886);

#endif

_CCCL_SUPPRESS_DEPRECATED_POP
9 changes: 7 additions & 2 deletions thrust/testing/async_sort.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include <cuda/__cccl_config>

// need to suppress deprecation warnings inside a lot of thrust headers
_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

// Disabled on MSVC && NVCC < 11.1 for GH issue #1098.
Expand All @@ -15,8 +20,6 @@

# include <unittest/unittest.h>

_CCCL_SUPPRESS_DEPRECATED_PUSH

enum wait_policy
{
wait_for_futures,
Expand Down Expand Up @@ -177,3 +180,5 @@ DECLARE_GENERIC_SIZED_UNITTEST_WITH_TYPES_AND_NAME(
// TODO: Test future return type.

#endif

_CCCL_SUPPRESS_DEPRECATED_POP
7 changes: 7 additions & 0 deletions thrust/testing/dependencies_aware_policies.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include <cuda/__cccl_config>

// need to suppress deprecation warnings for execute_with_allocator_and_dependencies inside type traits
_CCCL_SUPPRESS_DEPRECATED_PUSH

#include <thrust/detail/config.h>

#include <thrust/detail/seq.h>
Expand Down Expand Up @@ -113,3 +118,5 @@ SimpleUnitTest<TestDependencyAttachment,
#endif
>>
TestDependencyAttachmentInstance;

_CCCL_SUPPRESS_DEPRECATED_POP
4 changes: 4 additions & 0 deletions thrust/testing/event.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# include <unittest/unittest.h>
# include <unittest/util_async.h>

// note: there is no matching _CCCL_SUPPRESS_DEPRECATED_POP, so the warning suppression leaks into more content of the
// generated cudafe1.stub.c file.
_CCCL_SUPPRESS_DEPRECATED_PUSH

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

_CCCL_HOST void test_event_default_constructed()
Expand Down
4 changes: 4 additions & 0 deletions thrust/testing/future.cu
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# include <unittest/unittest.h>
# include <unittest/util_async.h>

// note: there is no matching _CCCL_SUPPRESS_DEPRECATED_POP, so the warning suppression leaks into more content of the
// generated cudafe1.stub.c file.
_CCCL_SUPPRESS_DEPRECATED_PUSH

struct mock
{};

Expand Down
2 changes: 2 additions & 0 deletions thrust/thrust/async/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ namespace async
namespace unimplemented
{

_CCCL_SUPPRESS_DEPRECATED_PUSH
template <typename FromPolicy, typename ToPolicy, typename ForwardIt, typename Sentinel, typename OutputIt>
CCCL_DEPRECATED _CCCL_HOST event<FromPolicy> async_copy(
thrust::execution_policy<FromPolicy>& from_exec,
Expand All @@ -63,6 +64,7 @@ CCCL_DEPRECATED _CCCL_HOST event<FromPolicy> async_copy(
"this algorithm is not implemented for the specified system");
return {};
}
_CCCL_SUPPRESS_DEPRECATED_POP

} // namespace unimplemented

Expand Down
2 changes: 2 additions & 0 deletions thrust/thrust/async/for_each.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ namespace async
namespace unimplemented
{

_CCCL_SUPPRESS_DEPRECATED_PUSH
template <typename DerivedPolicy, typename ForwardIt, typename Sentinel, typename UnaryFunction>
CCCL_DEPRECATED _CCCL_HOST event<DerivedPolicy>
async_for_each(thrust::execution_policy<DerivedPolicy>&, ForwardIt, Sentinel, UnaryFunction)
Expand All @@ -59,6 +60,7 @@ async_for_each(thrust::execution_policy<DerivedPolicy>&, ForwardIt, Sentinel, Un
"this algorithm is not implemented for the specified system");
return {};
}
_CCCL_SUPPRESS_DEPRECATED_POP

} // namespace unimplemented

Expand Down
Loading

0 comments on commit ffc5f6d

Please sign in to comment.