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
10 changes: 10 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ CompileFlags:

---

# For libcudacxx test files, add include path to test support headers
If:
PathMatch: ".*libcudacxx/test/.*[.]cpp"

CompileFlags:
Add:
- -I../../../libcudacxx/test/support

---

# Tweak the clangd parse settings for all files
CompileFlags:
Compiler: clang++
Expand Down
6 changes: 0 additions & 6 deletions cudax/include/cuda/experimental/__detail/type_traits.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@

namespace cuda::experimental
{
template <class _Type, template <class...> class _Template>
inline constexpr bool __is_specialization_of_v = false;

template <template <class...> class _Template, class... _Args>
inline constexpr bool __is_specialization_of_v<_Template<_Args...>, _Template> = true;

template <template <class...> class _Fn, class... _Ts>
inline constexpr bool __is_instantiable_with_v = _CUDA_VSTD::_IsValidExpansion<_Fn, _Ts...>::value;

Expand Down
22 changes: 0 additions & 22 deletions cudax/include/cuda/experimental/__detail/utility.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,12 @@

#include <cuda/std/__cccl/prologue.h>

// BUG (gcc#98995): copy elision fails when initializing a [[no_unique_address]] field
// from a function returning an object of class type by value.
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98995
#if _CCCL_COMPILER(GCC)
// By declaring the move constructor but not defining it, any TU that ODR-uses the move
// constructor will cause a linker error.
# define _CCCL_IMMOVABLE_OPSTATE(_XP) _CCCL_API _XP(_XP&&) noexcept
#else // ^^^ _CCCL_COMPILER(GCC) ^^^ / vvv !_CCCL_COMPILER(GCC) vvv
# define _CCCL_IMMOVABLE_OPSTATE(_XP) _XP(_XP&&) = delete
#endif // !_CCCL_COMPILER(GCC)

namespace cuda::experimental
{
// NOLINTBEGIN(misc-unused-using-decls)
using _CUDA_VSTD::declval;
// NOLINTEND(misc-unused-using-decls)

// Classes can inherit from this type to become immovable.
struct _CCCL_TYPE_VISIBILITY_DEFAULT __immovable
{
_CCCL_HIDE_FROM_ABI __immovable() = default;
_CCCL_IMMOVABLE_OPSTATE(__immovable);
};

template <class... _Types>
struct _CCCL_TYPE_VISIBILITY_DEFAULT _CCCL_DECLSPEC_EMPTY_BASES __inherit : _Types...
{};

struct _CCCL_TYPE_VISIBILITY_DEFAULT no_init_t
{
_CCCL_HIDE_FROM_ABI explicit no_init_t() = default;
Expand Down
3 changes: 2 additions & 1 deletion cudax/include/cuda/experimental/__execution/bulk.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#endif // no system header

#include <cuda/__cmath/ceil_div.h>
#include <cuda/__utility/immovable.h>
#include <cuda/std/__concepts/arithmetic.h>
#include <cuda/std/__concepts/same_as.h>
#include <cuda/std/__tuple_dir/ignore.h>
Expand Down Expand Up @@ -168,7 +169,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT __bulk_t
, __opstate_{execution::connect(static_cast<_CvSndr&&>(__sndr), __rcvr_t{{&__state_}})}
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API constexpr void start() noexcept
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__type_traits/is_specialization_of.h>
#include <cuda/std/__tuple_dir/ignore.h>
#include <cuda/std/__type_traits/conditional.h>
#include <cuda/std/__type_traits/integral_constant.h>
Expand Down Expand Up @@ -165,7 +166,7 @@ inline constexpr bool sends_stopped = __sends_stopped<completion_signatures_of_t
// __valid_completion_signatures
template <class _Ty>
_CCCL_CONCEPT __valid_completion_signatures =
__is_specialization_of_v<_CUDA_VSTD::remove_const_t<_Ty>, completion_signatures>;
::cuda::__is_specialization_of_v<_CUDA_VSTD::remove_const_t<_Ty>, completion_signatures>;

template <class... _Sigs>
_CCCL_API _CCCL_CONSTEVAL void __assert_valid_completion_signatures(const completion_signatures<_Sigs...>&)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__cccl/unreachable.h>
#include <cuda/std/__type_traits/is_callable.h>
#include <cuda/std/__type_traits/is_convertible.h>
Expand Down Expand Up @@ -185,7 +186,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT conditional_t
, __op_{execution::connect(static_cast<_CvSndr&&>(__sndr), __rcvr_t{&__state_})}
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API constexpr void start() noexcept
{
Expand Down
5 changes: 3 additions & 2 deletions cudax/include/cuda/experimental/__execution/env.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <cuda/__memory_resource/get_memory_resource.h>
#include <cuda/__memory_resource/properties.h>
#include <cuda/__stream/get_stream.h>
#include <cuda/__type_traits/is_specialization_of.h>
#include <cuda/std/__concepts/concept_macros.h>
#include <cuda/std/__execution/env.h>
#include <cuda/std/__tuple_dir/ignore.h>
Expand Down Expand Up @@ -82,7 +83,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT __env_ref_fn
}

_CCCL_TEMPLATE(class _Env, class = _Env*) // not considered if _Env is a reference type
_CCCL_REQUIRES((!__is_specialization_of_v<_Env, __fwd_env_>) )
_CCCL_REQUIRES((!::cuda::__is_specialization_of_v<_Env, __fwd_env_>) )
[[nodiscard]] _CCCL_TRIVIAL_API constexpr auto operator()(_Env&& __env) const noexcept -> _Env
{
return static_cast<_Env&&>(__env);
Expand Down Expand Up @@ -150,7 +151,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT __fwd_env_fn
[[nodiscard]] _CCCL_TRIVIAL_API constexpr auto operator()(_Env&& __env) const noexcept(__nothrow_movable<_Env>)
-> decltype(auto)
{
if constexpr (__is_specialization_of_v<_CUDA_VSTD::remove_cvref_t<_Env>, __fwd_env_>)
if constexpr (::cuda::__is_specialization_of_v<_CUDA_VSTD::remove_cvref_t<_Env>, __fwd_env_>)
{
// If the environment is already a forwarding environment, we can just return it.
return static_cast<_Env>(static_cast<_Env&&>(__env)); // take care to not return an rvalue reference
Expand Down
3 changes: 2 additions & 1 deletion cudax/include/cuda/experimental/__execution/just.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__utility/pod_tuple.h>

#include <cuda/experimental/__detail/utility.cuh>
Expand Down Expand Up @@ -61,7 +62,7 @@ private:
// operation state doesn't strictly need to be immovable, since its address never
// escapes. So for gcc, we let this operation state be movable.
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98995
_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);
#endif // !_CCCL_COMPILER(GCC)

_CCCL_API constexpr void start() noexcept
Expand Down
3 changes: 2 additions & 1 deletion cudax/include/cuda/experimental/__execution/let_value.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__cccl/unreachable.h>
#include <cuda/std/__type_traits/decay.h>
#include <cuda/std/__type_traits/fold.h>
Expand Down Expand Up @@ -207,7 +208,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT __let_t
, __opstate1_(execution::connect(static_cast<_CvSndr&&>(__sndr), __rcvr_t{&__state_}))
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API constexpr void start() noexcept
{
Expand Down
3 changes: 2 additions & 1 deletion cudax/include/cuda/experimental/__execution/rcvr_ref.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__type_traits/is_specialization_of.h>
#include <cuda/std/__memory/addressof.h>
#include <cuda/std/__type_traits/is_nothrow_copy_constructible.h>
#include <cuda/std/__type_traits/is_same.h>
Expand Down Expand Up @@ -102,7 +103,7 @@ template <class _Env = void, class _Rcvr>
{
return execution::__ref_rcvr<env_of_t<_Rcvr>>(__rcvr);
}
else if constexpr (__is_specialization_of_v<_Rcvr, __rcvr_ref>)
else if constexpr (::cuda::__is_specialization_of_v<_Rcvr, __rcvr_ref>)
{
return __rcvr;
}
Expand Down
3 changes: 2 additions & 1 deletion cudax/include/cuda/experimental/__execution/read_env.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__cccl/unreachable.h>
#include <cuda/std/__type_traits/is_callable.h>
#include <cuda/std/__type_traits/is_void.h>
Expand Down Expand Up @@ -56,7 +57,7 @@ private:
: __rcvr_(static_cast<_Rcvr&&>(__rcvr))
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_EXEC_CHECK_DISABLE
_CCCL_API void start() noexcept
Expand Down
2 changes: 2 additions & 0 deletions cudax/include/cuda/experimental/__execution/run_loop.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>

#include <cuda/experimental/__detail/utility.cuh>
#include <cuda/experimental/__execution/atomic_intrusive_queue.cuh>
#include <cuda/experimental/__execution/completion_signatures.cuh>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__cccl/unreachable.h>
#include <cuda/std/__concepts/same_as.h>
#include <cuda/std/__type_traits/conditional.h>
Expand Down Expand Up @@ -308,7 +309,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT schedule_from_t
, __opstate1_{execution::connect(static_cast<_CvSndr&&>(__sndr), __stash_rcvr_t{&__state_})}
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API constexpr void start() noexcept
{
Expand Down
3 changes: 2 additions & 1 deletion cudax/include/cuda/experimental/__execution/sequence.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__cccl/unreachable.h>
#include <cuda/std/__tuple_dir/ignore.h>

Expand Down Expand Up @@ -97,7 +98,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT sequence_t
, __opstate1_(execution::connect(static_cast<_Sndr1&&>(__sndr1), __rcvr_t<_Rcvr, _Sndr2>{&__state_}))
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API constexpr void start() noexcept
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__exception/terminate.h>

#include <cuda/experimental/__detail/utility.cuh>
Expand Down Expand Up @@ -79,7 +80,7 @@ private:
: __opstate_(execution::connect(static_cast<_Sndr&&>(__sndr), __rcvr_t{this, &__destroy}))
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API constexpr void start() noexcept
{
Expand Down
3 changes: 2 additions & 1 deletion cudax/include/cuda/experimental/__execution/starts_on.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__cccl/unreachable.h>
#include <cuda/std/__utility/pod_tuple.h>

Expand Down Expand Up @@ -231,7 +232,7 @@ struct starts_on_t
: __state_{__sch, static_cast<_CvSndr&&>(__sndr), static_cast<_Rcvr&&>(__rcvr)}
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API constexpr void start() noexcept
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__concepts/concept_macros.h>
#include <cuda/std/__memory/unique_ptr.h>
#include <cuda/std/__type_traits/is_same.h>
Expand Down Expand Up @@ -221,7 +222,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT __opstate_t
(__device_make_state(static_cast<_CvSndr&&>(__sndr), static_cast<_Rcvr&&>(__rcvr));));
}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API constexpr void start() noexcept
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__type_traits/is_specialization_of.h>
#include <cuda/std/__tuple_dir/ignore.h>
#include <cuda/std/__utility/forward_like.h>

Expand Down Expand Up @@ -51,7 +52,7 @@ struct __bulk_chunked_t : execution::__bulk_t<__bulk_chunked_t>

if (__tid < this->__state_->__shape_)
{
if constexpr (__is_specialization_of_v<_Fn, bulk_t::__bulk_chunked_fn>)
if constexpr (::cuda::__is_specialization_of_v<_Fn, bulk_t::__bulk_chunked_fn>)
{
// If the chunked function was adapted from an unchunked function, we can call
// the unchunked functions directly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#include <cuda/__device/device_ref.h>
#include <cuda/__stream/get_stream.h>
#include <cuda/__utility/immovable.h>

#include <cuda/experimental/__execution/stream/scheduler.cuh>
#include <cuda/experimental/stream.cuh>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#endif // no system header

#include <cuda/__stream/get_stream.h>
#include <cuda/__type_traits/is_specialization_of.h>
#include <cuda/__utility/immovable.h>
#include <cuda/std/__utility/forward_like.h>

#include <cuda/experimental/__detail/utility.cuh>
Expand Down Expand Up @@ -88,7 +90,7 @@ struct __continues_on_t
, __opstate_(execution::connect(static_cast<_Sndr&&>(__sndr), __rcvr_t<_Rcvr>{__rcvr_}))
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_HOST_API void start() noexcept
{
Expand Down Expand Up @@ -154,7 +156,7 @@ struct __continues_on_t

// If the child sender has not already been adapted to be a stream sender,
// we adapt it now.
if constexpr (!__is_specialization_of_v<decltype(__child), __stream::__sndr_t>)
if constexpr (!::cuda::__is_specialization_of_v<decltype(__child), __stream::__sndr_t>)
{
auto __adapted_sndr = __stream::__adapt(static_cast<__child_t&&>(__child));
using __adapted_sndr_t = decltype(__adapted_sndr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#endif // no system header

#include <cuda/__stream/get_stream.h>
#include <cuda/__utility/immovable.h>
#include <cuda/std/__concepts/concept_macros.h>

#include <cuda/experimental/__execution/completion_signatures.cuh>
Expand Down Expand Up @@ -102,7 +103,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT stream_scheduler
"stream scheduler's operation state must be allocated in managed memory");
}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API void start() noexcept
{
Expand Down
3 changes: 2 additions & 1 deletion cudax/include/cuda/experimental/__execution/then.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__cccl/unreachable.h>
#include <cuda/std/__type_traits/is_callable.h>
#include <cuda/std/__type_traits/is_same.h>
Expand Down Expand Up @@ -188,7 +189,7 @@ struct __upon_t
, __opstate_{execution::connect(static_cast<_CvSndr&&>(__sndr), __rcvr_t{&__state_})}
{}

_CCCL_IMMOVABLE_OPSTATE(__opstate_t);
_CCCL_IMMOVABLE(__opstate_t);

_CCCL_API constexpr void start() noexcept
{
Expand Down
1 change: 1 addition & 0 deletions cudax/include/cuda/experimental/__execution/utility.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# pragma system_header
#endif // no system header

#include <cuda/__utility/immovable.h>
#include <cuda/std/__concepts/constructible.h>
#include <cuda/std/__cuda/api_wrapper.h>
#include <cuda/std/__exception/cuda_error.h>
Expand Down
Loading