1#include <muda/buffer/buffer_launch.h>
5template <
bool IsConst,
typename T>
6MUDA_GENERIC VarViewT<IsConst, T>::VarViewT(auto_const_t<T>* data) MUDA_NOEXCEPT
11template <
bool IsConst,
typename T>
12template <
bool OtherIsConst>
13MUDA_GENERIC VarViewT<IsConst, T>::VarViewT(
const VarViewT<OtherIsConst, T>& other) MUDA_NOEXCEPT
14 : m_data(other.m_data)
18template <
bool IsConst,
typename T>
19MUDA_GENERIC
auto VarViewT<IsConst, T>::data() const MUDA_NOEXCEPT->auto_const_t<T>*
24template <
bool IsConst,
typename T>
25MUDA_GENERIC
auto VarViewT<IsConst, T>::cviewer() const MUDA_NOEXCEPT->ConstViewer
27 return ConstViewer{m_data};
30template <
bool IsConst,
typename T>
31MUDA_GENERIC
auto VarViewT<IsConst, T>::viewer() const MUDA_NOEXCEPT->ThisViewer
33 return ThisViewer{m_data};
36template <
bool IsConst,
typename T>
37MUDA_GENERIC
auto VarViewT<IsConst, T>::as_const() const MUDA_NOEXCEPT->ConstView
39 return ConstView{*
this};
42template <
bool IsConst,
typename T>
43void VarViewT<IsConst, T>::copy_from(
const T* val)
const MUDA_REQUIRES(!IsConst)
45 static_assert(!IsConst,
"Cannot copy to const var");
48 .template copy<T>(*
this, val)
52template <
bool IsConst,
typename T>
53void VarViewT<IsConst, T>::copy_to(T* val)
const
56 .template copy<T>(val, *
this)
60template <
bool IsConst,
typename T>
61void VarViewT<IsConst, T>::copy_from(
const ConstView& val)
const MUDA_REQUIRES(!IsConst)
63 static_assert(!IsConst,
"Cannot copy to const var");
66 .template copy<T>(*
this, val)
70template <
bool IsConst,
typename T>
71void VarViewT<IsConst, T>::fill(
const T& val)
const MUDA_REQUIRES(!IsConst)
73 static_assert(!IsConst,
"Cannot fill const var");
76 .template fill<T>(*
this, val)