Skip to content

Commit

Permalink
fix the forwarding of the receiver in the just_from algorithm (#2569)
Browse files Browse the repository at this point in the history
* fix the forwarding of the receiver in the `just_from` algorithm

* suppress clang deprecation warning about `prop` and `env`

* suppress clang warning about unknown diagnostic
  • Loading branch information
ericniebler authored Oct 14, 2024
1 parent 59fc1bf commit e86947f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions cudax/include/cuda/experimental/__async/env.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@

#include <cuda/experimental/__async/prologue.cuh>

_CCCL_DIAG_PUSH

// Suppress the warning: "definition of implicit copy constructor for 'env<>' is
// deprecated because it has a user-declared copy assignment operator". We need to
// suppress this warning rather than fix the code because defaulting or defining
// the copy constructor would prevent aggregate initialization, which these types
// depend on.
_CCCL_DIAG_SUPPRESS_CLANG("-Wunknown-warning-option")
_CCCL_DIAG_SUPPRESS_CLANG("-Wdeprecated-copy")

// warning #20012-D: __device__ annotation is ignored on a
// function("inplace_stop_source") that is explicitly defaulted on its first
// declaration
Expand Down Expand Up @@ -62,6 +72,8 @@ struct prop
{
return __value;
}

prop& operator=(const prop&) = delete;
};

template <class... _Envs>
Expand Down Expand Up @@ -90,6 +102,8 @@ struct env
{
return __get_1st(__query).__query(__query);
}

env& operator=(const env&) = delete;
};

// partial specialization for two environments
Expand Down Expand Up @@ -122,6 +136,8 @@ struct env<_Env0, _Env1>
{
return __get_1st(__query).__query(__query);
}

env& operator=(const env&) = delete;
};

template <class... _Envs>
Expand Down Expand Up @@ -187,6 +203,8 @@ using env_of_t = decltype(get_env(__declval<_Ty>()));

_CCCL_NV_DIAG_DEFAULT(20012)

_CCCL_DIAG_POP

#include <cuda/experimental/__async/epilogue.cuh>

#endif
2 changes: 1 addition & 1 deletion cudax/include/cuda/experimental/__async/just_from.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private:
template <class... _Ts>
_CCCL_HOST_DEVICE auto operator()(_Ts&&... __ts) const noexcept
{
_SetTag()(static_cast<_Rcvr&>(__rcvr_), static_cast<_Ts&&>(__ts)...);
_SetTag()(static_cast<_Rcvr&&>(__rcvr_), static_cast<_Ts&&>(__ts)...);
}
};

Expand Down

0 comments on commit e86947f

Please sign in to comment.