Skip to content

Commit

Permalink
Move env_t into namespace cudax
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Nov 25, 2024
1 parent ef034bb commit 0ec249e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions cudax/include/cuda/experimental/__execution/env.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,23 @@
#include <cuda/experimental/__stream/get_stream.cuh>
#include <cuda/experimental/__stream/stream_ref.cuh>

namespace cuda::experimental::execution
namespace cuda::experimental
{

template <class... _Properties>
class env_t
{
private:
using __resource = ::cuda::experimental::mr::any_async_resource<_Properties...>;
using __stream_ref = ::cuda::experimental::stream_ref;
using __resource = mr::any_async_resource<_Properties...>;
using __stream_ref = stream_ref;

__resource __mr_ = ::cuda::experimental::mr::device_memory_resource{};
__stream_ref __stream_ = ::cuda::experimental::detail::__invalid_stream;
__resource __mr_ = mr::device_memory_resource{};
__stream_ref __stream_ = detail::__invalid_stream;
execution_policy __policy_ = execution_policy::invalid_execution_policy;

public:
//! @brief Default constructs an environment using
//! * ``::cuda::experimental::mr::device_memory_resource`` as the resource
//! * ``mr::device_memory_resource`` as the resource
//! * the default stream
//! * ``execution_policy::invalid_execution_policy`` as the execution policy
_CCCL_HIDE_FROM_ABI env_t() = default;
Expand All @@ -60,7 +60,7 @@ public:
//! @param __stream The stream_ref passed in
//! @param __policy The execution_policy passed in
_CCCL_HIDE_FROM_ABI env_t(__resource __mr,
__stream_ref __stream = ::cuda::experimental::detail::__invalid_stream,
__stream_ref __stream = detail::__invalid_stream,
execution_policy __policy = execution_policy::invalid_execution_policy) noexcept
: __mr_(_CUDA_VSTD::move(__mr))
, __stream_(__stream)
Expand All @@ -71,9 +71,8 @@ public:
//! properties we need
template <class _Env>
static constexpr bool __is_compatible_env =
::cuda::experimental::__async::__queryable<_Env, get_memory_resource_t>
&& ::cuda::experimental::__async::__queryable<_Env, get_stream_t>
&& ::cuda::experimental::__async::__queryable<_Env, get_execution_policy_t>;
__async::__queryable<_Env, get_memory_resource_t> && __async::__queryable<_Env, get_stream_t>
&& __async::__queryable<_Env, get_execution_policy_t>;

//! @brief Construct from an environment that has the right queries
//! @param __env The environment we are querying for the required information
Expand Down Expand Up @@ -101,6 +100,6 @@ public:
}
};

} // namespace cuda::experimental::execution
} // namespace cuda::experimental

#endif //__CUDAX___EXECUTION_ENV_CUH
2 changes: 1 addition & 1 deletion cudax/test/execution/env.cu
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <catch2/catch.hpp>

namespace cudax = cuda::experimental;
using env_t = cudax::execution::env_t<cuda::mr::device_accessible>;
using env_t = cudax::env_t<cuda::mr::device_accessible>;

struct test_resource
{
Expand Down

0 comments on commit 0ec249e

Please sign in to comment.