Skip to content

Commit

Permalink
fix the cudax vector_add sample (#2372)
Browse files Browse the repository at this point in the history
the cudax `vector_add` sample has not compiled since [0251ae4]. it was broken by PR #2343, which added a type `::cuda::experimental::stream_ref` distinct from `::cuda::stream_ref`. all unqualified mentions of `stream_ref` within the `cuda::experimental` namespace were made to refer to a different type. this causes problems in `cudax/samples/vector_add/vector.cuh` which has several unqualified uses of `stream_ref`.
  • Loading branch information
ericniebler committed Sep 5, 2024
1 parent 046a761 commit 3876dcc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cudax/samples/vector_add/vector.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public:
}

private:
void sync_host_to_device(stream_ref __str, detail::__param_kind __p) const
void sync_host_to_device(::cuda::stream_ref __str, detail::__param_kind __p) const
{
if (__dirty_)
{
Expand All @@ -78,7 +78,7 @@ private:
}
}

void sync_device_to_host(stream_ref __str, detail::__param_kind __p) const
void sync_device_to_host(::cuda::stream_ref __str, detail::__param_kind __p) const
{
if (__p != detail::__param_kind::_in)
{
Expand All @@ -94,7 +94,7 @@ private:
using __cv_vector = ::cuda::std::__maybe_const<_Kind == detail::__param_kind::_in, vector>;

public:
explicit __action(stream_ref __str, __cv_vector& __v) noexcept
explicit __action(::cuda::stream_ref __str, __cv_vector& __v) noexcept
: __str_(__str)
, __v_(__v)
{
Expand All @@ -116,25 +116,25 @@ private:
}

private:
stream_ref __str_;
::cuda::stream_ref __str_;
__cv_vector& __v_;
};

_CCCL_NODISCARD_FRIEND __action<detail::__param_kind::_inout>
__cudax_launch_transform(stream_ref __str, vector& __v) noexcept
__cudax_launch_transform(::cuda::stream_ref __str, vector& __v) noexcept
{
return __action<detail::__param_kind::_inout>{__str, __v};
}

_CCCL_NODISCARD_FRIEND __action<detail::__param_kind::_in>
__cudax_launch_transform(stream_ref __str, const vector& __v) noexcept
__cudax_launch_transform(::cuda::stream_ref __str, const vector& __v) noexcept
{
return __action<detail::__param_kind::_in>{__str, __v};
}

template <detail::__param_kind _Kind>
_CCCL_NODISCARD_FRIEND __action<_Kind>
__cudax_launch_transform(stream_ref __str, detail::__box<vector, _Kind> __b) noexcept
__cudax_launch_transform(::cuda::stream_ref __str, detail::__box<vector, _Kind> __b) noexcept
{
return __action<_Kind>{__str, __b.__val};
}
Expand Down

0 comments on commit 3876dcc

Please sign in to comment.