18 size_t m_pitch_bytes = 0;
19 Extent2D m_extent = Extent2D::Zero();
20 Extent2D m_capacity = Extent2D::Zero();
36 void copy_to(std::vector<T>& host)
const;
37 void copy_from(
const std::vector<T>& host);
40 void resize(
Extent2D new_extent,
const T& value);
44 void fill(
const T& v);
46 Dense2D<T> viewer() MUDA_NOEXCEPT {
return view().viewer(); }
47 CDense2D<T> cviewer()
const MUDA_NOEXCEPT {
return view().viewer(); }
51 return view().subview(offset, extent);
55 return Buffer2DView<T>{m_data, m_pitch_bytes, Offset2D::Zero(), m_extent};
61 return view().subview(offset, extent);
72 auto extent()
const MUDA_NOEXCEPT {
return m_extent; }
73 auto capacity()
const MUDA_NOEXCEPT {
return m_capacity; }
74 auto pitch_bytes()
const MUDA_NOEXCEPT {
return m_pitch_bytes; }
75 auto total_size()
const MUDA_NOEXCEPT
77 return m_extent.width() * m_extent.height();
79 T* data() MUDA_NOEXCEPT {
return m_data; }
80 const T* data()
const MUDA_NOEXCEPT {
return m_data; }