Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
aa8d882
Add debug and static-member-fn support to sequence-sender
kirkshoop Sep 30, 2025
4e37d4d
switch `__seqexpr` to use static-member-fn to customize `subscribe` a…
kirkshoop Sep 30, 2025
fef35d8
add `__well_formed_sequence_sender` constraints to `ignore_all_values…
kirkshoop Sep 30, 2025
f7da526
improve debugging for `transform_each`
kirkshoop Sep 30, 2025
082a9e4
move sequence ERROR structs into exec namespace
kirkshoop Sep 30, 2025
4cca273
add `merge` algorithm for sequence-senders
kirkshoop Sep 30, 2025
ef85ae8
fix bugs in merge and transform_each
kirkshoop Oct 12, 2025
86c2afb
apply PR feedback
kirkshoop Oct 12, 2025
b3ca212
remove requires clause that was preventing diagnosis of failed type c…
kirkshoop Oct 12, 2025
bb09c37
diagnostics improvements for sequence sender
kirkshoop Oct 12, 2025
3f1ba21
add merge_each sequence sender adaptor
kirkshoop Oct 12, 2025
5117f8b
provide aliases for exec::materialize_t and exec::dematerialize_t
kirkshoop Oct 18, 2025
d63efcf
fix compiler error construction in merge
kirkshoop Oct 18, 2025
41a2f09
fix some ordering and error handling issues in merge_each
kirkshoop Oct 18, 2025
28d9367
improve compile errors for sequence senders
kirkshoop Oct 18, 2025
be05244
prevent trailing return types from causing subscribe, get_completion_…
kirkshoop Oct 18, 2025
b1b1614
add the option to specify a scheduler to iterate.
kirkshoop Oct 18, 2025
84b041f
add test_scheduler and marble and notification
kirkshoop Oct 18, 2025
b70a136
Merge branch 'main' into addmerge
ericniebler Oct 19, 2025
da25787
remove windows-only compilation error debug aid that is breaking wind…
kirkshoop Oct 21, 2025
54e46e2
replace static_thread_pool with single_thread_context. static_thread_…
kirkshoop Oct 29, 2025
3229813
Merge branch 'main' into addmerge
ericniebler Oct 29, 2025
8364f1a
clang-format changes
kirkshoop Oct 29, 2025
f58736e
remove _t from concept name
kirkshoop Oct 29, 2025
431c67c
simplify meta expression at the behest of Visual Studio
kirkshoop Oct 29, 2025
825110f
compile time debug changes
kirkshoop Oct 29, 2025
73d3cb0
Merge branch 'addmerge' into add-merge_each
kirkshoop Oct 29, 2025
9c71ef2
fix crash in delays_each_on
kirkshoop Oct 31, 2025
71da7d9
Merge remote-tracking branch 'origin/addmerge' into add-merge_each
kirkshoop Oct 31, 2025
36b00e2
clang-format changes
kirkshoop Oct 31, 2025
3cbf83b
fix bad copy/paste
kirkshoop Oct 31, 2025
ec14797
clang-format changes
kirkshoop Oct 31, 2025
dbd27ac
Merge branch 'add-merge_each' into marbletesting
kirkshoop Oct 31, 2025
09c57f3
update transform_iterate to work with specified scheduler support in …
kirkshoop Nov 1, 2025
6bed02b
silence visual studio unreachable warnings
kirkshoop Nov 1, 2025
9fd303d
fix visual studio errors
kirkshoop Nov 1, 2025
a309693
fixes visual studio compile errors and runtime crashes
kirkshoop Nov 1, 2025
3d93782
fix delays_each_on
kirkshoop Nov 1, 2025
175e734
fix clang19 build
kirkshoop Nov 1, 2025
ff06ec6
Merge remote-tracking branch 'upstream/main' into add-merge_each
kirkshoop Nov 1, 2025
f8841c5
fix bad merge
kirkshoop Nov 1, 2025
0fc8423
Merge branch 'add-merge_each' into marbletesting
kirkshoop Nov 1, 2025
2b48dfe
how did this ever compile?
kirkshoop Nov 1, 2025
ce05c8f
remove checks in multithreaded tests that cause test failures on slow…
kirkshoop Nov 1, 2025
23ab4b8
Merge branch 'add-merge_each' into marbletesting
kirkshoop Nov 1, 2025
850a25c
fixes warnings and errors in clang16
kirkshoop Nov 2, 2025
50d6ce7
get nvhpc compiling
kirkshoop Nov 6, 2025
307ead3
Merge branch 'add-merge_each' into marbletesting
kirkshoop Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test_scheduler and marble and notification
  • Loading branch information
kirkshoop committed Oct 19, 2025
commit 84b041f4ab9d722d5958760034108e849fe6bacf
812 changes: 812 additions & 0 deletions include/exec/sequence/marbles.hpp

Large diffs are not rendered by default.

243 changes: 243 additions & 0 deletions include/exec/sequence/notification.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
/*
* Copyright (c) 2023 Maikel Nadolski
* Copyright (c) 2023 NVIDIA Corporation
*
* Licensed under the Apache License Version 2.0 with LLVM Exceptions
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://llvm.org/LICENSE.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once

#include "../../stdexec/concepts.hpp"
#include "../../stdexec/execution.hpp"
#include "stdexec/__detail/__concepts.hpp"
#include "stdexec/__detail/__config.hpp"
#include "stdexec/__detail/__tuple.hpp"
#include <concepts>

namespace exec {
namespace __notification {
using namespace stdexec;

//
// notification_t provides storage for any one of the
// completions in the specified completion_signatures<>
//
// notification_t can be compared, visited by a receiver
// to emit the stored signal, and provide a sender that will
// complete with the stored signal
//

template <class... _Ts>
using __nothrow_decay_copyable_and_move_constructible_t = __mbool<(
(__nothrow_decay_copyable<_Ts> && __nothrow_move_constructible<__decay_t<_Ts>>) && ...)>;

template <class... Args>
using __as_rvalues = set_value_t (*)(__decay_t<Args>...);

template <class... E>
using __as_error = set_error_t (*)(E...);

// Here we convert all set_value(Args...) to set_value(__decay_t<Args>...). Note, we keep all
// error types as they are and unconditionally add set_stopped(). The indirection through the
// __completions_fn is to avoid a pack expansion bug in nvc++.
struct __completions_fn {
template <class _CompletionSignatures>
using __all_value_args_nothrow_decay_copyable = __value_types_t<
_CompletionSignatures,
__qq<__nothrow_decay_copyable_and_move_constructible_t>,
__qq<__mand_t>
>;

template <class _CompletionSignatures>
using __f = __mtry_q<__concat_completion_signatures>::__f<
__eptr_completion_if_t<__all_value_args_nothrow_decay_copyable<_CompletionSignatures>>,
completion_signatures<set_stopped_t()>,
__transform_completion_signatures<
_CompletionSignatures,
__as_rvalues,
__as_error,
set_stopped_t (*)(),
__completion_signature_ptrs
>
>;
};

template <class _CompletionSignatures>
using __notification_storage_t = __for_each_completion_signature<
__minvoke<__completions_fn, _CompletionSignatures>,
__decayed_tuple,
std::variant
>;

template<class _CompletionSignatures>
struct __notification_sender;

template<class _CompletionSignatures>
struct notification_t {
using __notification_t = __notification_storage_t<_CompletionSignatures>;
using __notification_sender_t = stdexec::__t<__notification_sender<_CompletionSignatures>>;

__notification_t __notification_{};

template <class _Notification>
using __tag_of_t = stdexec::__mapply<stdexec::__q<stdexec::__mfront>, STDEXEC_REMOVE_REFERENCE(_Notification)>;

template<class _Tag, class... _Args>
notification_t(_Tag __tag, _Args&&... __args)
noexcept(
noexcept(
__notification_.template emplace<__decayed_tuple<_Tag, STDEXEC_REMOVE_REFERENCE(_Args)...>>(
__tag,
static_cast<_Args&&>(__args)...))) {
__notification_.template emplace<__decayed_tuple<_Tag, STDEXEC_REMOVE_REFERENCE(_Args)...>>(__tag, static_cast<_Args&&>(__args)...);
}

template<class _Fn>
auto visit(_Fn&& __fn) const noexcept {
return std::visit(
[&__fn](auto&& __tuple) noexcept {
return __tuple.apply([&__fn](auto __tag, auto&&... __args) noexcept {
return static_cast<_Fn&&>(__fn)(__tag, __args...);
}
, __tuple);
}
, __notification_);
}
template<class _Receiver>
void visit_receiver(_Receiver&& __receiver) noexcept {
std::visit(
[&__receiver](auto&& __tuple) noexcept {
__tuple.apply([&__receiver](auto __tag, auto&&... __args) noexcept {
__tag(static_cast<_Receiver&&>(__receiver), static_cast<decltype(__args)&&>(__args)...);
}
, static_cast<decltype(__tuple)&&>(__tuple));
}
, static_cast<__notification_t&&>(__notification_));
}
auto visit_sender() noexcept -> __notification_sender_t;

[[nodiscard]] bool value() const noexcept {
return std::visit(
[]<class _Tuple>(const _Tuple&) noexcept {
return stdexec::__decays_to<stdexec::set_value_t, __tag_of_t<_Tuple>>;
}
, __notification_);
}
[[nodiscard]] bool error() const noexcept {
return std::visit(
[]<class _Tuple>(const _Tuple&) noexcept {
return stdexec::__decays_to<stdexec::set_error_t, __tag_of_t<_Tuple>>;
}
, __notification_);
}
[[nodiscard]] bool stopped() const noexcept {
return std::visit(
[]<class _Tuple>(const _Tuple&) noexcept {
return stdexec::__decays_to<stdexec::set_stopped_t, __tag_of_t<_Tuple>>;
}
, __notification_);
}

friend auto operator==(
const notification_t& __lhs,
const notification_t& __rhs) noexcept -> bool {
return std::visit(
[]<class _Lhs, class _Rhs>(const _Lhs& __lhs, const _Rhs& __rhs) noexcept {
if constexpr (
!std::same_as<__tag_of_t<_Lhs>, __tag_of_t<_Rhs>>
|| stdexec::__v<stdexec::__mapply<stdexec::__msize, _Lhs>> != stdexec::__v<stdexec::__mapply<stdexec::__msize, _Rhs>>) {
return false;
} else {
return __lhs.apply([&__rhs]<class _LTag, class... _LArgs>(_LTag, const _LArgs&... __l_args){
return __rhs.apply([&]<class _RTag, class... _RArgs>(_RTag, const _RArgs&... __r_args){
if constexpr ((std::equality_comparable_with<const _LArgs&, const _RArgs&> && ... && true)) {
return ((__l_args == __r_args) && ... && true);
} else {
return false;
}
}
, __rhs);
}
, __lhs);
}
}
, __lhs.__notification_, __rhs.__notification_);
}

friend std::string to_string(const notification_t& __self) noexcept {
using std::to_string;
return __self.visit([](auto __tag, const auto&... __args){
int count = 0;
return to_string(__tag) + "(" + (((count++ > 0 ? ", " : "") + to_string(__args)) + ... + std::string{}) + ")";
});
}
};

template <class _ReceiverId, class _CompletionSignatures>
struct __notification_op {
using _Receiver = stdexec::__t<_ReceiverId>;
using __notification_t = notification_t<_CompletionSignatures>;

struct __t {
using __id = __notification_op;

_Receiver __receiver_;
__notification_t* __notification_;

void start() & noexcept {
__notification_->visit_receiver(static_cast<_Receiver&&>(__receiver_));
}
};
};

template<class _CompletionSignatures>
struct __notification_sender {
using __notification_t = notification_t<_CompletionSignatures>;
struct __t {
using __id = __notification_sender;
using sender_concept = stdexec::sender_t;

template<class _ReceiverId>
using __notification_op_t = stdexec::__t<__notification_op<_ReceiverId, _CompletionSignatures>>;

__notification_t* __notification_;

template <stdexec::__decays_to<__t> _Self, class... _Env>
static auto get_completion_signatures(_Self&&, _Env&&...) noexcept
-> _CompletionSignatures {
return {};
}

template <std::same_as<__t> _Self, receiver _Receiver>
static auto connect(_Self&& __self, _Receiver&& __rcvr)
noexcept(__nothrow_move_constructible<_Receiver>)
-> __notification_op_t<stdexec::__id<_Receiver>> {
return {static_cast<_Receiver&&>(__rcvr),
__self.__notification_};
}
};
};

template<class _CompletionSignatures>
auto notification_t<_CompletionSignatures>::visit_sender() noexcept
-> notification_t<_CompletionSignatures>::__notification_sender_t {
return {this};
}

} // namespace __notification
template<class _CompletionSignatures>
using notification_t = __notification::notification_t<_CompletionSignatures>;

namespace __notification {

} // namespace __notification
} // namespace exec
Loading
Loading