Conversation
db2f61a to
9327406
Compare
|
/ok to test fd9d04b |
fd9d04b to
707aed3
Compare
|
The latest push includes an implementation of I have also tried to address the build failures on the previous iteration, but I don't have a local test environment for the failing build types so I haven't tested the fixes locally, other than to confirm that they still build with my local Clang (i.e. |
707aed3 to
66f394c
Compare
|
Rebased on #1717. |
96d4661 to
f786c00
Compare
|
/ok to test f786c00 |
67262ee to
97d79ee
Compare
|
/ok to test 97d79ee |
97d79ee to
95d10a7
Compare
|
I managed to get GCC 12 installed on my Mac and it repro'd the ICE and the build failure in |
52e1755 to
521d849
Compare
|
|
521d849 to
cc867f4
Compare
|
/ok to test cc867f4 |
a1dd153 to
9263dab
Compare
|
I think I've fixed the build breaks in old gcc, nvc++, and MSVC. Getting a repro of the gcc 11 builds was quite a pain—I can't figure out how to get gcc 11 to run properly on macOS Tahoe so I had to use I've updated |
9263dab to
254887d
Compare
|
Pull the guts of |
254887d to
f78a329
Compare
|
Do some template hoisting and renaming, and replace a single |
f78a329 to
e6db1ed
Compare
ac53b93 to
8cf9dbd
Compare
|
Add |
8cf9dbd to
4717c70
Compare
|
/ok to test 4717c70 |
4717c70 to
34c7c35
Compare
|
I think I've fixed both the gcc build errors and the memory leak. The GPUs seems to be on holiday, though—I haven't seen any CI results from the GPU jobs in a while. |
34c7c35 to
6596a20
Compare
|
/ok to test 6596a20 |
|
/ok to test 7f04df1 |
0ece92d to
a7c40ee
Compare
|
|
/ok to test a7c40ee |
|
/ok to test 3c160e1 |
3c160e1 to
c5ee582
Compare
|
/ok to test c5ee582 |
This diff adds a definition for `concept stdexec::scope_association` plus tests confirming it accepts and rejects the expected things.
This diff adds a definition for `concept stdexec::scope_token` plus tests confirming it accepts and rejects the expected things. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
This diff defines `stdexec::associate` and adds some initial tests to confirm it works properly. Still a work in progress.
This diff defines `stdexec::__stop_when` as the implementation of _`stop-when`_ and adds tests to validate the algorithm. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
This diff adds `stdexec::spawn` and its tests. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
This diff adds `stdexec::simple_counting_scope` and `stdexec::counting_scope` plus tests for both. The tests found a spec bug that's been filed as an LWG issue. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
This diff adds `stdexec::spawn_future` and some basic tests. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
c5ee582 to
2ac3fb0
Compare
|
I just force-pushed after rebasing on |
This diff probably implements the intended design that stop requests sent to a started future-sender get forwarded to the spawned work. The existing tests still pass, but I don't have new tests to confirm the new behaviour. Co-authored-by: Eric Niebler <eniebler@nvidia.com>
2ac3fb0 to
ed8e376
Compare
|
I've re-jiggered the implementation of stop request handling in |
ericniebler
left a comment
There was a problem hiding this comment.
this is looking amazing. minor comments only. lmk if you want a hand with merge conflicts.
| // but the above code ICEs gcc 11 and 12 (and maybe MSVC) | ||
| // so we declare a named callable | ||
| struct __deleter { | ||
| constexpr void operator()(__wrap_sender_t* p) const noexcept { |
There was a problem hiding this comment.
all identifier names need to be uglified.
| constexpr void operator()(__wrap_sender_t* p) const noexcept { | |
| constexpr void operator()(__wrap_sender_t* __p) const noexcept { |
| __associate_data(__associate_data&& __other) | ||
| noexcept(__nothrow_move_constructible<__wrap_sender_t>) |
There was a problem hiding this comment.
move operations should all be noexcept unconditionally. you can then static_assert that __nothrow_move_constructible<__wrap_sender_t> is true.
| } | ||
| }; | ||
|
|
||
| using __sender_ref = std::unique_ptr<__wrap_sender_t, __deleter>; |
There was a problem hiding this comment.
using a unique_ptr for this seems like overkill. my preference would be to use the __scope_guard in __detail/__scope.hpp instead. something like:
__scope_guard __g{std::destroy_at<_Sender>, &__sndr};| } | ||
|
|
||
| std::pair<__assoc_t, __sender_ref> release() && noexcept { | ||
| __sender_ref u(__assoc_ ? std::addressof(__sndr_) : nullptr); |
There was a problem hiding this comment.
i don't think you can pass nullptr to std::destroy_at the way you can with delete.
| } | ||
|
|
||
| private: | ||
| __associate_data(std::pair<__assoc_t, __sender_ref> __parts) |
There was a problem hiding this comment.
| __associate_data(std::pair<__assoc_t, __sender_ref> __parts) | |
| explicit __associate_data(std::pair<__assoc_t, __sender_ref> __parts) |
| // to avoid invoking request_stop when it's unnecessary. It might be. | ||
| // | ||
| // We *must* invoke request_stop before returning from the function if our CAS | ||
| // succeeds (because we arrived before either __complete or __coneume), or if the |
There was a problem hiding this comment.
| // succeeds (because we arrived before either __complete or __coneume), or if the | |
| // succeeds (because we arrived before either __complete or __consume), or if the |
| void __do_consume(auto& __rcvr) noexcept { | ||
| using __variant_t = decltype(this->__result_); | ||
|
|
||
| __variant_t::visit( |
There was a problem hiding this comment.
| __variant_t::visit( | |
| __visit( |
| auto* op = traits::allocate(alloc, 1); | ||
|
|
||
| try { | ||
| traits::construct( | ||
| alloc, | ||
| op, | ||
| alloc, | ||
| static_cast<_Sender&&>(__sndr), | ||
| static_cast<_Token&&>(__tkn), | ||
| __spawn_common::__choose_senv(__env, get_env(__sndr))); | ||
| } catch (...) { | ||
| traits::deallocate(alloc, op, 1); | ||
| throw; | ||
| } |
There was a problem hiding this comment.
god i hate having to deal with allocators. scope guard here instead of try/catch.
| // __data_of<_Sender> is a unique_ptr specialization | ||
| using __unique_ptr_t = __data_of<std::remove_cvref_t<_Sender>>; | ||
|
|
||
| __future_operation_base(__unique_ptr_t&& __future) noexcept |
| return __apply( | ||
| [&__rcvr](__ignore, auto&& token, __ignore) noexcept { | ||
| return __make_token_fn{}( | ||
| static_cast<decltype(token)>(token), get_stop_token(STDEXEC::get_env(__rcvr))); | ||
| }, | ||
| static_cast<_Self&&>(__self)); |
There was a problem hiding this comment.
i think this can now be (untested):
auto &[__tag, __token, __child] = __self;
return __make_token_fn{}(__forward_like<_Self>(__token),
get_stop_token(STDEXEC::get_env(__rcvr)));
This PR will implement P3149R11 patched with P3815R1.
concept scope_associationconcept scope_tokenassociatealgorithmstop-whenalgorithmspawnalgorithmspawn_futurealgorithmsimple_counting_scopecounting_scope