Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions include/nvexec/stream/when_all.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ namespace nv::execution::_strm
{
namespace _when_all
{
using STDEXEC::__when_all::_THE_GIVEN_SENDER_CAN_COMPLETE_SUCCESSFULLY_IN_MORE_THAN_ONE_WAY_;
using STDEXEC::__when_all::_USE_WHEN_ALL_WITH_VARIANT_INSTEAD_;

enum disposition : std::uint32_t
{
started,
Expand Down Expand Up @@ -75,14 +78,11 @@ namespace nv::execution::_strm
requires(too_many_completions_sender<Senders, Env...> || ...)
struct completions<__mlist<Env...>, Senders...>
{
static constexpr auto position_of() noexcept -> std::size_t
{
constexpr bool which[] = {too_many_completions_sender<Senders, Env...>...};
return __pos_of(which, which + sizeof...(Senders));
}

using invalid_arg_t = __m_at_c<position_of(), Senders...>;
using __t = STDEXEC::__when_all::__too_many_value_completions_error_t<invalid_arg_t, Env...>;
using __t =
__mexception<_WHAT_(_INVALID_ARGUMENT_),
_WHERE_(_IN_ALGORITHM_, when_all_t),
_WHY_(_THE_GIVEN_SENDER_CAN_COMPLETE_SUCCESSFULLY_IN_MORE_THAN_ONE_WAY_),
_TO_FIX_THIS_ERROR_(_USE_WHEN_ALL_WITH_VARIANT_INSTEAD_)>;
};

template <class... Env, class... Senders>
Expand Down
11 changes: 6 additions & 5 deletions include/stdexec/__detail/__basic_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ namespace STDEXEC
template <class _Tag, class _Indices>
struct __connect;

template <class _Sexpr>
using __connect_t = __connect<tag_of_t<_Sexpr>, __child_indices_t<_Sexpr>>;

template <class _Tag, std::size_t... _Idx>
struct __connect<_Tag, __indices<_Idx...>>
{
Expand All @@ -129,9 +126,13 @@ namespace STDEXEC
}
};

template <class _Sexpr>
using __connect_t = __connect<tag_of_t<_Sexpr>, __child_indices_t<_Sexpr>>;

template <class _Sexpr, class _Receiver>
concept __connectable_to =
__applicable<__connect_t<_Sexpr>, _Sexpr, __state_type_t<_Sexpr, _Receiver>&>;
sender_in<_Sexpr, env_of_t<_Receiver>>
&& __applicable<__connect_t<_Sexpr>, _Sexpr, __state_type_t<_Sexpr, _Receiver>&>;

STDEXEC_MODULE_EXPORT_AUTHORING
struct __defaults
Expand Down Expand Up @@ -283,8 +284,8 @@ namespace STDEXEC
struct __opstate
{
using __tag_t = __decay_t<_Sexpr>::__tag_t;
using __connect_t = __detail::__connect_t<_Sexpr>;
using __state_t = __detail::__state_type_t<_Sexpr, _Receiver>;
using __connect_t = __detail::__connect<__tag_t, __detail::__child_indices_t<_Sexpr>>;
using __child_ops_t = __apply_result_t<__connect_t, _Sexpr, __state_t&>;

constexpr explicit __opstate(_Sexpr&& __sndr, _Receiver __rcvr)
Expand Down
1 change: 0 additions & 1 deletion include/stdexec/__detail/__continues_on.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ namespace STDEXEC
__nothrow_constructible_from<__state_for_t<_Sender, _Receiver>,
__data_of<_Sender>&,
_Receiver>) -> __state_for_t<_Sender, _Receiver>
requires sender_in<__child_of<_Sender>, __fwd_env_t<env_of_t<_Receiver>>>
{
static_assert(__sender_for<_Sender, continues_on_t>);
auto& [__tag, __sched, __child] = __sndr;
Expand Down
11 changes: 7 additions & 4 deletions include/stdexec/__detail/__transform_completion_signatures.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,14 @@ namespace STDEXEC
template <class... _Args>
consteval auto operator()() const noexcept
{
if constexpr (__decay_copyable<_Args...>)
if constexpr (__nothrow_decay_copyable<_Args...>)
{
return __concat_completion_signatures(
completion_signatures<_SetTag(__decay_t<_Args>...)>(),
__eptr_completion_unless_t<__nothrow_decay_copyable_t<_Args...>>());
return completion_signatures<_SetTag(__decay_t<_Args>...)>();
}
else if constexpr (__decay_copyable<_Args...>)
{
return completion_signatures<_SetTag(__decay_t<_Args>...),
set_error_t(std::exception_ptr)>();
}
else
{
Expand Down
26 changes: 26 additions & 0 deletions include/stdexec/__detail/__tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,32 @@ namespace STDEXEC
}
};

struct __fold_right_t
{
template <__std::move_constructible _Init>
STDEXEC_ATTRIBUTE(always_inline, host, device)
constexpr auto operator()(__ignore, _Init&& __init) const
noexcept(__nothrow_move_constructible<_Init>) -> _Init
{
return static_cast<_Init&&>(__init);
}

template <class _Fn, class _Init, class _Head, class... _Tail>
requires __callable<_Fn&, _Init, _Head>
&& __callable<__fold_right_t, _Fn&, __call_result_t<_Fn&, _Init, _Head>, _Tail...>
STDEXEC_ATTRIBUTE(always_inline, host, device)
constexpr auto
operator()(_Fn&& __fn, _Init&& __init, _Head&& __head, _Tail&&... __tail) const //
noexcept(
__nothrow_callable<_Fn&, _Init, _Head>
&& __nothrow_callable<__fold_right_t, _Fn&, __call_result_t<_Fn&, _Init, _Head>, _Tail...>)
{
return (*this)(__fn,
__fn(static_cast<_Init&&>(__init), static_cast<_Head&&>(__head)),
static_cast<_Tail&&>(__tail)...);
}
};

# undef STDEXEC_TUPLE_GET
} // namespace __tup

Expand Down
Loading
Loading