1- #include < stdexec/execution.hpp>
21#include < test_common/catch2.hpp>
32
3+ #include < stdexec/execution.hpp>
4+
5+ #include < exec/env.hpp>
6+
7+ #include < nvexec/stream_context.cuh>
8+
49#include " common.cuh"
5- #include " nvexec/stream_context.cuh"
610
711#include < cuda/std/span>
812
@@ -26,7 +30,7 @@ namespace
2630 nvexec::stream_context stream_ctx{};
2731 auto const snd = ex::schedule (stream_ctx.get_scheduler ()) | ex::bulk (ex::par, 1 , [](int ) {});
2832
29- REQUIRE (STDEXEC ::sync_wait (snd).has_value ());
33+ REQUIRE (ex ::sync_wait (snd).has_value ());
3034 }
3135
3236 TEST_CASE (" nvexec bulk executes on GPU" , " [cuda][stream][adaptors][bulk]" )
@@ -46,7 +50,7 @@ namespace
4650 flags.set (idx);
4751 }
4852 });
49- STDEXEC ::sync_wait (std::move (snd));
53+ ex ::sync_wait (std::move (snd));
5054
5155 REQUIRE (flags_storage.all_set_once ());
5256 }
@@ -71,7 +75,7 @@ namespace
7175 }
7276 }
7377 });
74- STDEXEC ::sync_wait (std::move (snd));
78+ ex ::sync_wait (std::move (snd));
7579
7680 REQUIRE (flags_storage.all_set_once ());
7781 }
@@ -96,7 +100,7 @@ namespace
96100 }
97101 }
98102 });
99- auto const [i, d] = STDEXEC ::sync_wait (std::move (snd)).value ();
103+ auto const [i, d] = ex ::sync_wait (std::move (snd)).value ();
100104
101105 REQUIRE (flags_storage.all_set_once ());
102106 REQUIRE (i == 42 );
@@ -122,7 +126,7 @@ namespace
122126 flags.set (idx);
123127 }
124128 });
125- [[maybe_unused]] auto [flags_actual] = STDEXEC ::sync_wait (std::move (snd)).value ();
129+ [[maybe_unused]] auto [flags_actual] = ex ::sync_wait (std::move (snd)).value ();
126130
127131 REQUIRE (flags_storage.all_set_once ());
128132 }
@@ -152,7 +156,7 @@ namespace
152156 flags.set (2 );
153157 }
154158 });
155- STDEXEC ::sync_wait (std::move (snd));
159+ ex ::sync_wait (std::move (snd));
156160
157161 REQUIRE (flags_storage.all_set_once ());
158162 }
@@ -183,7 +187,7 @@ namespace
183187 flags.set (idx);
184188 }
185189 });
186- STDEXEC ::sync_wait (std::move (snd));
190+ ex ::sync_wait (std::move (snd));
187191
188192 REQUIRE (flags_storage.all_set_once ());
189193 }
@@ -205,7 +209,7 @@ namespace
205209 flags.set (idx);
206210 }
207211 });
208- STDEXEC ::sync_wait (std::move (snd)).value ();
212+ ex ::sync_wait (std::move (snd)).value ();
209213
210214 REQUIRE (flags_storage.all_set_once ());
211215 }
@@ -220,19 +224,19 @@ namespace
220224 int const nelems = 10 ;
221225 cudaMallocManaged (&inout, nelems * sizeof (double ));
222226
223- auto task = STDEXEC ::just (cuda::std::span<double >{inout, nelems})
224- | STDEXEC ::continues_on (ctx.get_scheduler ())
225- | STDEXEC ::bulk (ex::par,
226- nelems,
227- [](std::size_t i, cuda::std::span<double > out)
228- { out[i] = ( double ) i ; })
229- | STDEXEC::let_value ([](cuda::std::span< double > out) { return STDEXEC::just (out); })
230- | STDEXEC::bulk ( ex::par,
231- nelems ,
232- [](std:: size_t i, cuda::std::span< double > out)
233- { out[i] = 2.0 * out[i]; });
234-
235- STDEXEC ::sync_wait (std::move (task)).value ();
227+ auto task = ex ::just (cuda::std::span<double >{inout, nelems})
228+ | ex ::continues_on (ctx.get_scheduler ())
229+ | ex ::bulk (ex::par,
230+ nelems,
231+ [](std::size_t i, cuda::std::span<double > out) { out[i] = ( double ) i; } )
232+ | ex::let_value ([](cuda::std::span< double > out) { return ex::just (out) ; })
233+ | exec::write_attrs (
234+ ex::prop{ ex::get_completion_scheduler<ex:: set_value_t >, ctx. get_scheduler ()})
235+ | ex::bulk (ex::par ,
236+ nelems,
237+ [](std:: size_t i, cuda::std::span< double > out) { out[i] = 2.0 * out[i]; });
238+
239+ ex ::sync_wait (std::move (task)).value ();
236240
237241 for (int i = 0 ; i < nelems; ++i)
238242 {
0 commit comments