Skip to content

Commit

Permalink
rename __query to query now that P3325 has been accepted (#2757)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericniebler authored Nov 10, 2024
1 parent 9616009 commit ae182fd
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion cudax/include/cuda/experimental/__async/continue_on.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ struct continue_on_t::__sndr_t
_CUDAX_API auto query(_Query) const //
-> __query_result_t<_Query, env_of_t<_Sndr>>
{
return __async::get_env(__sndr->__sndr).__query(_Query{});
return __async::get_env(__sndr->__sndr).query(_Query{});
}
};

Expand Down
4 changes: 2 additions & 2 deletions cudax/include/cuda/experimental/__async/env.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ struct env
noexcept(__nothrow_queryable<__1st_env_t<_Query>, _Query>) //
-> __query_result_t<__1st_env_t<_Query>, _Query>
{
return __get_1st(__query).__query(__query);
return __get_1st(__query).query(__query);
}

env& operator=(const env&) = delete;
Expand Down Expand Up @@ -134,7 +134,7 @@ struct env<_Env0, _Env1>
noexcept(__nothrow_queryable<__1st_env_t<_Query>, _Query>) //
-> __query_result_t<__1st_env_t<_Query>, _Query>
{
return __get_1st(__query).__query(__query);
return __get_1st(__query).query(__query);
}

env& operator=(const env&) = delete;
Expand Down
42 changes: 21 additions & 21 deletions cudax/include/cuda/experimental/__async/queries.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ _CCCL_SUPPRESS_DEPRECATED_POP
namespace cuda::experimental::__async
{
template <class _Ty, class _Query>
auto __query_result_() -> decltype(__declval<_Ty>().__query(_Query()));
auto __query_result_() -> decltype(__declval<_Ty>().query(_Query()));

template <class _Ty, class _Query>
using __query_result_t = decltype(__query_result_<_Ty, _Query>());
Expand All @@ -48,7 +48,7 @@ template <class _Ty, class _Query>
inline constexpr bool __nothrow_queryable = true;
#else
template <class _Ty, class _Query>
using __nothrow_queryable_ = __mif<noexcept(__declval<_Ty>().__query(_Query()))>;
using __nothrow_queryable_ = __mif<noexcept(__declval<_Ty>().query(_Query()))>;

template <class _Ty, class _Query>
inline constexpr bool __nothrow_queryable = __mvalid_q<__nothrow_queryable_, _Ty, _Query>;
Expand All @@ -58,10 +58,10 @@ _CCCL_GLOBAL_CONSTANT struct get_allocator_t
{
template <class _Env>
_CUDAX_API auto operator()(const _Env& __env) const noexcept //
-> decltype(__env.__query(*this))
-> decltype(__env.query(*this))
{
static_assert(noexcept(__env.__query(*this)));
return __env.__query(*this);
static_assert(noexcept(__env.query(*this)));
return __env.query(*this);
}

_CUDAX_API auto operator()(__ignore) const noexcept -> _CUDA_VSTD::allocator<void>
Expand All @@ -74,10 +74,10 @@ _CCCL_GLOBAL_CONSTANT struct get_stop_token_t
{
template <class _Env>
_CUDAX_API auto operator()(const _Env& __env) const noexcept //
-> decltype(__env.__query(*this))
-> decltype(__env.query(*this))
{
static_assert(noexcept(__env.__query(*this)));
return __env.__query(*this);
static_assert(noexcept(__env.query(*this)));
return __env.query(*this);
}

_CUDAX_API auto operator()(__ignore) const noexcept -> never_stop_token
Expand All @@ -94,10 +94,10 @@ struct get_completion_scheduler_t
{
template <class _Env>
_CUDAX_API auto operator()(const _Env& __env) const noexcept //
-> decltype(__env.__query(*this))
-> decltype(__env.query(*this))
{
static_assert(noexcept(__env.__query(*this)));
return __env.__query(*this);
static_assert(noexcept(__env.query(*this)));
return __env.query(*this);
}
};

Expand All @@ -108,21 +108,21 @@ _CCCL_GLOBAL_CONSTANT struct get_scheduler_t
{
template <class _Env>
_CUDAX_API auto operator()(const _Env& __env) const noexcept //
-> decltype(__env.__query(*this))
-> decltype(__env.query(*this))
{
static_assert(noexcept(__env.__query(*this)));
return __env.__query(*this);
static_assert(noexcept(__env.query(*this)));
return __env.query(*this);
}
} get_scheduler{};

_CCCL_GLOBAL_CONSTANT struct get_delegatee_scheduler_t
{
template <class _Env>
_CUDAX_API auto operator()(const _Env& __env) const noexcept //
-> decltype(__env.__query(*this))
-> decltype(__env.query(*this))
{
static_assert(noexcept(__env.__query(*this)));
return __env.__query(*this);
static_assert(noexcept(__env.query(*this)));
return __env.query(*this);
}
} get_delegatee_scheduler{};

Expand All @@ -137,10 +137,10 @@ _CCCL_GLOBAL_CONSTANT struct get_forward_progress_guarantee_t
{
template <class _Sch>
_CUDAX_API auto operator()(const _Sch& __sch) const noexcept //
-> decltype(__async::__decay_copy(__sch.__query(*this)))
-> decltype(__async::__decay_copy(__sch.query(*this)))
{
static_assert(noexcept(__sch.__query(*this)));
return __sch.__query(*this);
static_assert(noexcept(__sch.query(*this)));
return __sch.query(*this);
}

_CUDAX_API auto operator()(__ignore) const noexcept -> forward_progress_guarantee
Expand All @@ -153,7 +153,7 @@ _CCCL_GLOBAL_CONSTANT struct get_domain_t
{
template <class _Sch>
_CUDAX_API constexpr auto operator()(const _Sch& __sch) const noexcept //
-> decltype(__async::__decay_copy(__sch.__query(*this)))
-> decltype(__async::__decay_copy(__sch.query(*this)))
{
return {};
}
Expand Down
4 changes: 2 additions & 2 deletions cudax/include/cuda/experimental/__async/rcvr_with_env.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct __rcvr_with_env_t : _Rcvr
noexcept(__nothrow_queryable<_1st_env_t<_Query>, _Query>) //
-> __query_result_t<_1st_env_t<_Query>, _Query>
{
return __get_1st(__query).__query(__query);
return __get_1st(__query).query(__query);
}

_Env __env_;
Expand Down Expand Up @@ -128,7 +128,7 @@ struct __rcvr_with_env_t<_Rcvr*, _Env>
noexcept(__nothrow_queryable<_1st_env_t<_Query>, _Query>) //
-> __query_result_t<_1st_env_t<_Query>, _Query>
{
return __get_1st(__query).__query(__query);
return __get_1st(__query).query(__query);
}

_Rcvr* __rcvr_;
Expand Down
2 changes: 1 addition & 1 deletion cudax/include/cuda/experimental/__async/start_on.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct __sch_env_t
{
_Sch __sch_;

_Sch __query(get_scheduler_t) const noexcept
_Sch query(get_scheduler_t) const noexcept
{
return __sch_;
}
Expand Down
4 changes: 2 additions & 2 deletions cudax/include/cuda/experimental/__async/when_all.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,15 @@ struct __env_t

__state_t& __state_;

_CUDAX_API inplace_stop_token __query(get_stop_token_t) const noexcept
_CUDAX_API inplace_stop_token query(get_stop_token_t) const noexcept
{
return __state_.__stop_token_;
}

template <class _Tag>
_CUDAX_API auto query(_Tag) const noexcept -> __query_result_t<_Tag, env_of_t<__rcvr_t>>
{
return __async::get_env(__state_.__rcvr_).__query(_Tag());
return __async::get_env(__state_.__rcvr_).query(_Tag());
}
};

Expand Down

0 comments on commit ae182fd

Please sign in to comment.