Skip to content

Commit

Permalink
async_rw_mutex comp sigs & typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorostsa committed Jul 3, 2024
1 parent 2be9faa commit 81b972d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ namespace hpx { namespace cuda { namespace experimental {
struct transform_stream_receiver
{
#ifdef HPX_HAVE_STDEXEC
using is_receiver = void;
using receiver_concept = hpx::execution::experimental::receiver_t;
#endif
std::decay_t<R> r;
std::decay_t<F> f;
Expand Down Expand Up @@ -324,10 +324,13 @@ namespace hpx { namespace cuda { namespace experimental {
>;
// clang-format on
#else
template <typename Tuple>
struct invoke_result_helper;

template <template <typename...> class Tuple, typename... Ts>
struct invoke_result_helper<Tuple<Ts...>>
{
static_assert(hpx::is_invocable_v<F, Args..., cudaStream_t>,
static_assert(hpx::is_invocable_v<F, Ts..., cudaStream_t>,
"F not invocable with the value_types specified.");

using result_type =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ namespace hpx::execution::experimental {
template <typename Sender, typename Shape, typename F>
struct bulk_sender
{
using is_sender = void;
HPX_NO_UNIQUE_ADDRESS std::decay_t<Sender> sender;
HPX_NO_UNIQUE_ADDRESS std::decay_t<Shape> shape;
HPX_NO_UNIQUE_ADDRESS std::decay_t<F> f;

#ifdef HPX_HAVE_STDEXEC
using sender_concept = hpx::execution::experimental::sender_t;

template <typename... Args>
using default_set_value =
hpx::execution::experimental::completion_signatures<
Expand Down Expand Up @@ -78,6 +79,8 @@ namespace hpx::execution::experimental {
return hpx::execution::experimental::get_env(s.sender);
}
#else
using is_sender = void;

template <typename Env>
struct generate_completion_signatures
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,18 @@ namespace hpx::experimental {
using access_type =
detail::async_rw_mutex_access_wrapper<readwrite_type, read_type,
AccessType>;
#ifdef HPX_HAVE_STDEXEC
using sender_concept = hpx::execution::experimental::sender_t;

template <typename Env>
friend auto tag_invoke(
hpx::execution::experimental::get_completion_signatures_t,
sender const&, Env)
-> hpx::execution::experimental::completion_signatures<
hpx::execution::experimental::set_value_t(access_type),
hpx::execution::experimental::set_error_t(
std::exception_ptr)>;
#else
template <typename Env>
struct generate_completion_signatures
{
Expand All @@ -456,6 +467,7 @@ namespace hpx::experimental {
friend auto tag_invoke(
hpx::execution::experimental::get_completion_signatures_t,
sender const&, Env) -> generate_completion_signatures<Env>;
#endif

template <typename R>
struct operation_state
Expand Down Expand Up @@ -634,16 +646,25 @@ namespace hpx::experimental {
template <detail::async_rw_mutex_access_type AccessType>
struct sender
{
#ifdef HPX_HAVE_STDEXEC
using is_sender = void;
#endif
shared_state_ptr_type prev_state;
shared_state_ptr_type state;

using access_type =
detail::async_rw_mutex_access_wrapper<readwrite_type, read_type,
AccessType>;

#ifdef HPX_HAVE_STDEXEC
using sender_concept = hpx::execution::experimental::sender_t;

template <typename Env>
friend auto tag_invoke(
hpx::execution::experimental::get_completion_signatures_t,
sender const&, Env)
-> hpx::execution::experimental::completion_signatures<
hpx::execution::experimental::set_value_t(access_type),
hpx::execution::experimental::set_error_t(
std::exception_ptr)>;
#else
template <typename Env>
struct generate_completion_signatures
{
Expand All @@ -661,6 +682,7 @@ namespace hpx::experimental {
friend auto tag_invoke(
hpx::execution::experimental::get_completion_signatures_t,
sender const&, Env) -> generate_completion_signatures<Env>;
#endif

template <typename R>
struct operation_state
Expand Down

0 comments on commit 81b972d

Please sign in to comment.