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
4 changes: 2 additions & 2 deletions include/exec/any_sender_of.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace experimental::execution

template <class QueryFn, class... Env>
inline constexpr auto _check_query_v = std::conditional_t<sizeof...(Env) == 0,
_ERROR_<dependent_sender_error>,
__mexception<dependent_sender_error>,
_no_query_error_t<QueryFn, Env...>>{};

template <class Result, class Query, class... Args, class... Env>
Expand Down Expand Up @@ -477,7 +477,7 @@ namespace experimental::execution
using _base_t::_base_t;

template <__std::derived_from<_interface_> Self, class... Env>
static consteval auto get_completion_signatures() noexcept
static consteval auto get_completion_signatures()
{
// throw if Env does not contain the queries needed to type-erase the receiver:
using _check_queries_t = __mfind_error<_check_query_t<Queries, Env...>...>;
Expand Down
14 changes: 8 additions & 6 deletions include/exec/detail/system_context_replaceability_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@

#include <memory>

STDEXEC_PRAGMA_PUSH()
STDEXEC_PRAGMA_IGNORE_GNU("-Wdeprecated-declarations")
STDEXEC_PRAGMA_IGNORE_MSVC(4996) // warning C4996: 'function': was declared deprecated
STDEXEC_PRAGMA_IGNORE_EDG(deprecated_entity)
STDEXEC_PRAGMA_IGNORE_EDG(deprecated_entity_with_custom_message)

namespace experimental::execution
{
namespace [[deprecated("Use the " STDEXEC_PP_STRINGIZE(STDEXEC) //
Expand All @@ -47,11 +53,6 @@ namespace experimental::execution
return STDEXEC::parallel_scheduler_replacement::query_parallel_scheduler_backend();
}

STDEXEC_PRAGMA_PUSH()
STDEXEC_PRAGMA_IGNORE_GNU("-Wdeprecated-declarations")
STDEXEC_PRAGMA_IGNORE_MSVC(4996) // warning C4996: 'function': was declared deprecated
STDEXEC_PRAGMA_IGNORE_EDG(deprecated_entity)
STDEXEC_PRAGMA_IGNORE_EDG(deprecated_entity_with_custom_message)
/// Set a factory for the parallel scheduler backend.
/// Can be used to replace the parallel scheduler at runtime.
/// Out of spec.
Expand All @@ -63,7 +64,6 @@ namespace experimental::execution
{
return STDEXEC::parallel_scheduler_replacement::set_parallel_scheduler_backend(__new_factory);
}
STDEXEC_PRAGMA_POP()

/// Interface for completing a sender operation. Backend will call frontend though this interface
/// for completing the `schedule` and `schedule_bulk` operations.
Expand All @@ -79,6 +79,8 @@ namespace experimental::execution
} // namespace system_context_replaceability
} // namespace experimental::execution

STDEXEC_PRAGMA_POP()

namespace exec = experimental::execution;

#endif
5 changes: 5 additions & 0 deletions include/exec/sequence/any_sequence_of.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include "../any_sender_of.hpp"
#include "../sequence_senders.hpp"

STDEXEC_PRAGMA_PUSH()
STDEXEC_PRAGMA_IGNORE_GNU("-Woverloaded-virtual")

namespace experimental::execution
{
template <class _Sigs, class _Queries = queries<>>
Expand Down Expand Up @@ -225,4 +228,6 @@ namespace experimental::execution
};
} // namespace experimental::execution

STDEXEC_PRAGMA_POP()

namespace exec = experimental::execution;
2 changes: 1 addition & 1 deletion include/exec/sequence/merge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace experimental::execution
}

template <class _Self, class... _Env>
static consteval auto get_completion_signatures() noexcept
static consteval auto get_completion_signatures()
{
static_assert(sender_for<_Self, merge_t>);
auto __items = STDEXEC::__children_of<_Self, STDEXEC::__qq<item_types>>();
Expand Down
6 changes: 3 additions & 3 deletions include/exec/sequence/transform_each.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ namespace experimental::execution

template <class _Adaptor, class _Sequence>
auto operator()(__ignore, _Adaptor __adaptor, _Sequence&& __sequence)
noexcept(__nothrow_decay_copyable<_Adaptor> && __nothrow_decay_copyable<_Sequence>)
noexcept(__nothrow_decay_copyable<_Adaptor, _Sequence>)
-> __operation<_Sequence, _Receiver, _Adaptor>
{
return {static_cast<_Sequence&&>(__sequence),
Expand All @@ -138,8 +138,8 @@ namespace experimental::execution
{
template <sender _Sequence, __sender_adaptor_closure _Adaptor>
auto operator()(_Sequence&& __sndr, _Adaptor&& __adaptor) const
noexcept(__nothrow_decay_copyable<_Sequence> && __nothrow_decay_copyable<_Adaptor>)
-> __well_formed_sequence_sender auto
noexcept(__nothrow_decay_copyable<_Sequence, _Adaptor>) //
-> __well_formed_sequence_sender auto
{
return make_sequence_expr<transform_each_t>(static_cast<_Adaptor&&>(__adaptor),
static_cast<_Sequence&&>(__sndr));
Expand Down
87 changes: 46 additions & 41 deletions include/exec/sequence_senders.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ namespace experimental::execution
template <class... _Senders>
struct item_types
{
template <class _Fn, class _Continuation = STDEXEC::__qq<STDEXEC::__mlist>>
static constexpr auto __transform(_Fn __fn, _Continuation __continuation = {})
template <class _Transform, class _Reduce>
static constexpr auto __transform([[maybe_unused]] _Transform _transform, _Reduce _reduce)
{
return __continuation(__fn.template operator()<_Senders>()...);
return _reduce(_transform.template operator()<_Senders>()...);
}
};

Expand All @@ -253,42 +253,6 @@ namespace experimental::execution
struct _FAILED_TO_COMPUTE_SEQUENCE_ITEM_TYPES_
{};

#if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS()

template <class... _What, class... _Values>
[[nodiscard]]
consteval auto __invalid_item_types(_Values...)
{
return STDEXEC::__mexception<_What...>();
}

#else // ^^^ no constexpr exceptions ^^^ / vvv constexpr exceptions vvv

// C++26, https://wg21.link/p3068
template <class _What, class... _More, class... _Values>
[[noreturn, nodiscard]]
consteval auto __invalid_item_types([[maybe_unused]] _Values... __values) -> item_types<>
{
if constexpr (sizeof...(_Values) == 1)
{
throw __sequence_type_check_failure<_Values..., _What, _More...>(__values...);
}
else
{
throw __sequence_type_check_failure<STDEXEC::__tuple<_Values...>, _What, _More...>(
STDEXEC::__tuple{__values...});
}
}

#endif // ^^^ constexpr exceptions ^^^

template <class... _What>
[[nodiscard]]
consteval auto __invalid_item_types(STDEXEC::__mexception<_What...>)
{
return exec::__invalid_item_types<_What...>();
}

template <class _Sequence, class... _Env>
using __unrecognized_sequence_error_t =
STDEXEC::__mexception<STDEXEC::_WHAT_(_UNRECOGNIZED_SEQUENCE_TYPE_),
Expand Down Expand Up @@ -376,11 +340,12 @@ namespace experimental::execution
}
else if constexpr (sizeof...(_Env) == 0)
{
return STDEXEC::__dependent_sender<_Sequence>();
return STDEXEC::__dependent_sender_r<item_types<>, _Sequence>();
}
else
{
return __unrecognized_sequence_error_t<_Sequence, _Env...>();
return STDEXEC::__throw_compile_time_error_r<item_types<>>(
__unrecognized_sequence_error_t<_Sequence, _Env...>());
}
}

Expand Down Expand Up @@ -591,6 +556,46 @@ namespace experimental::execution
_Data __data_{};
};

#if STDEXEC_NO_STDCPP_CONSTEXPR_EXCEPTIONS()

template <class... _What, class... _Values>
[[nodiscard]]
consteval auto __invalid_item_types(_Values...)
{
return STDEXEC::__mexception<_What...>();
}

#else // ^^^ no constexpr exceptions ^^^ / vvv constexpr exceptions vvv

// C++26, https://wg21.link/p3068
template <class _What, class... _More, class... _Values>
[[noreturn, nodiscard]]
consteval auto __invalid_item_types([[maybe_unused]] _Values... __values) -> item_types<>
{
if constexpr (STDEXEC::__same_as<_What, STDEXEC::dependent_sender_error>)
{
throw STDEXEC::__mexception<STDEXEC::dependent_sender_error, _More...>();
}
else if constexpr (sizeof...(_Values) == 1)
{
throw __sequence_type_check_failure<_Values..., _What, _More...>(__values...);
}
else
{
throw __sequence_type_check_failure<STDEXEC::__tuple<_Values...>, _What, _More...>(
STDEXEC::__tuple<_Values...>{__values...});
}
}

#endif // ^^^ constexpr exceptions ^^^

template <class... _What>
[[nodiscard]]
consteval auto __invalid_item_types(STDEXEC::__mexception<_What...>)
{
return exec::__invalid_item_types<_What...>();
}

struct _MISSING_SET_NEXT_OVERLOAD_FOR_ITEM_
{};

Expand Down
16 changes: 9 additions & 7 deletions include/nvexec/stream/let_xxx.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -306,34 +306,36 @@ namespace nv::execution::_strm
STDEXEC_HOST_DEVICE_DEDUCTION_GUIDE
let_sender(Sender, Fun, SetTag) -> let_sender<Sender, Fun, SetTag>;

template <class SetTag>
template <class LetTag>
struct _transform_let_sender
{
using _set_tag = __t<LetTag>;

template <class Env, class Fun, class Sender>
auto operator()(Env const &, __ignore, Fun fn, Sender&& sndr) const
{
if constexpr (stream_completing_sender<Sender, Env>)
{
return let_sender{static_cast<Sender&&>(sndr), static_cast<Fun&&>(fn), SetTag{}};
return let_sender{static_cast<Sender&&>(sndr), static_cast<Fun&&>(fn), _set_tag{}};
}
else
{
using _let_t = decltype(STDEXEC::__let::__let_from_set<SetTag>);
return _strm::_no_stream_scheduler_in_env<_let_t, Sender, Env>();
return _strm::_no_stream_scheduler_in_env<LetTag, Sender, Env>();
}
}
};

template <>
struct transform_sender_for<STDEXEC::let_value_t> : _transform_let_sender<set_value_t>
struct transform_sender_for<STDEXEC::let_value_t> : _transform_let_sender<STDEXEC::let_value_t>
{};

template <>
struct transform_sender_for<STDEXEC::let_error_t> : _transform_let_sender<set_error_t>
struct transform_sender_for<STDEXEC::let_error_t> : _transform_let_sender<STDEXEC::let_error_t>
{};

template <>
struct transform_sender_for<STDEXEC::let_stopped_t> : _transform_let_sender<set_stopped_t>
struct transform_sender_for<STDEXEC::let_stopped_t>
: _transform_let_sender<STDEXEC::let_stopped_t>
{};
} // namespace nv::execution::_strm

Expand Down
3 changes: 2 additions & 1 deletion include/stdexec/__detail/__basic_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ namespace STDEXEC
}
else
{
return __throw_compile_time_error(__unrecognized_sender_error_t<_Self, _Env...>());
return STDEXEC::__throw_compile_time_error(
__unrecognized_sender_error_t<_Self, _Env...>());
}
}

Expand Down
Loading
Loading