Skip to content
Open
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
21 changes: 17 additions & 4 deletions include/exec/env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,23 +269,36 @@ namespace experimental::execution
{
template <class _Sender, class _Attrs>
STDEXEC_ATTRIBUTE(host, device)
constexpr auto operator()(_Sender snd, _Attrs __attrs_) const -> __sender<_Sender, _Attrs>
constexpr auto operator()(_Sender snd, _Attrs __attrs) const -> __sender<_Sender, _Attrs>
{
return __sender<_Sender, _Attrs>{static_cast<_Sender&&>(snd),
static_cast<_Attrs&&>(__attrs_)};
static_cast<_Attrs&&>(__attrs)};
}

template <class _Attrs>
STDEXEC_ATTRIBUTE(host, device)
constexpr auto operator()(_Attrs __attrs_) const
constexpr auto operator()(_Attrs __attrs) const
{
return STDEXEC::__closure(*this, static_cast<_Attrs&&>(__attrs_));
return STDEXEC::__closure(*this, static_cast<_Attrs&&>(__attrs));
}
};
} // namespace __write_attrs

inline constexpr __write_attrs::__write_attrs_t write_attrs{};

template <class Tag = STDEXEC::set_value_t, STDEXEC::scheduler Scheduler>
STDEXEC_ATTRIBUTE(host, device)
constexpr auto completes_on(Scheduler sched) noexcept
{
return exec::write_attrs(STDEXEC::prop{STDEXEC::get_completion_scheduler<Tag>, sched});
}

template <class Tag = STDEXEC::set_value_t, STDEXEC::sender Sender, STDEXEC::scheduler Scheduler>
STDEXEC_ATTRIBUTE(host, device)
constexpr auto completes_on(Sender sndr, Scheduler sched) noexcept
{
return exec::completes_on<Tag>(sched)(std::move(sndr));
}
} // namespace experimental::execution

namespace exec = experimental::execution;
Expand Down
3 changes: 2 additions & 1 deletion include/nvexec/stream/common.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ namespace nv::execution
return get_stream_provider(env)->own_stream_.value();
}

STDEXEC_ATTRIBUTE(host, device) auto operator()() const noexcept
STDEXEC_ATTRIBUTE(host, device)
auto operator()() const noexcept
{
return STDEXEC::read_env(*this);
}
Expand Down
10 changes: 8 additions & 2 deletions include/stdexec/__detail/__completion_behavior.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,17 @@ namespace STDEXEC
struct __common_t
{
template <__behavior... _CSs>
requires(sizeof...(_CSs) > 0)
STDEXEC_ATTRIBUTE(nodiscard, host, device)
constexpr auto operator()(__constant_t<_CSs>... __cbs) const noexcept
{
return (__cbs | ...);
if constexpr (sizeof...(_CSs) == 0)
{
return __completion_behavior::__unknown;
}
else
{
return (__cbs | ...);
}
}
};

Expand Down
Loading
Loading