Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
mdspec_traits.hpp
Go to the documentation of this file.
1#pragma once
2
10
11#include <type_traits>
12
13namespace uni20::linalg::detail::cuda_reference
14{
15
16template <class Accessor> struct RawCudaAccessorTraits
17{
18 static constexpr bool is_raw = false;
19 static constexpr bool is_mutable = false;
20 static constexpr bool is_const = false;
21};
22
23template <class ElementType> struct RawCudaAccessorTraits<uni20::cuda::CudaPointerAccessor<ElementType>>
24{
25 static constexpr bool is_raw = true;
26 static constexpr bool is_mutable = !std::is_const_v<ElementType>;
27 static constexpr bool is_const = std::is_const_v<ElementType>;
28};
29
30template <class Mdspec>
31inline constexpr bool is_raw_cuda_mdspec =
33 RawCudaAccessorTraits<typename std::remove_cvref_t<Mdspec>::accessor_type>::is_raw;
34
35template <class Mdspec>
36inline constexpr bool is_raw_mutable_cuda_mdspec =
38 RawCudaAccessorTraits<typename std::remove_cvref_t<Mdspec>::accessor_type>::is_mutable;
39
40template <class Mdspec>
41inline constexpr bool is_raw_const_cuda_mdspec =
43 RawCudaAccessorTraits<typename std::remove_cvref_t<Mdspec>::accessor_type>::is_const;
44
45} // namespace uni20::linalg::detail::cuda_reference
CUDA-accessible mdspec backed by a CudaBufferView descriptor.
Definition cuda_storage.hpp:118
CUDA Tensor storage with deferred device-memory data descriptors.
Definition async/async.hpp:26