20 template <FieldEntryLayout layout>
28 uint32_t m_elem_byte_size,
29 std::string_view name)
33 auto& info = m_core.m_info;
34 info.layout_info = layout_info;
37 info.elem_byte_size = m_elem_byte_size;
40 m_field.m_field.m_string_cache[std::string{m_field.name()} +
"." + m_name];
47 template <FieldEntryLayout Layout>
62 MUDA_GENERIC
const auto& core()
const {
return m_core; }
65 MUDA_GENERIC
auto layout_info()
const {
return core().layout_info(); }
66 MUDA_GENERIC
auto layout()
const {
return core().layout(); }
67 MUDA_GENERIC
auto count()
const {
return core().count(); }
68 MUDA_GENERIC
auto elem_byte_size()
const {
return core().elem_byte_size(); }
69 MUDA_GENERIC
auto shape()
const {
return core().shape(); }
70 MUDA_GENERIC
auto struct_stride()
const {
return core().struct_stride(); }
71 MUDA_GENERIC
auto name()
const {
return std::string_view{m_name}; }
77 static_assert(M > 0 && N > 0,
"M and N must be positive");
80 using ElementType =
typename FieldEntryView<T, Layout, M, N>::ElementType;
86 make_uint2(
static_cast<uint32_t
>(M),
static_cast<uint32_t
>(N)),
98 MUDA_ASSERT(m_field.data_buffer() !=
nullptr,
"Resize the field before you use it!");
100 m_host_device_core.view(), 0,
static_cast<int>(m_core.count())};
105 MUDA_ASSERT(m_field.data_buffer() !=
nullptr,
"Resize the field before you use it!");
107 m_host_device_core.view(), 0,
static_cast<int>(m_core.count())};
110 auto view(
int offset) {
return view().subview(offset); }
111 auto view(
int offset)
const {
return view().subview(offset); }
113 auto view(
int offset,
int count) {
return view().subview(offset, count); }
114 auto view(
int offset,
int count)
const
116 return view().subview(offset, count);
122 return view().viewer();
126 void copy_to(std::vector<ElementType>& dst)
const;
129 void copy_from(
const std::vector<ElementType>& src);
131 template <FieldEntryLayout SrcLayout>
137 auto dst = DstView{new_place, 0,
static_cast<int>(new_place->count())};
139 if(new_place->count() < this->count())
141 if(!m_field.allow_inplace_shrink())
145 std::as_const(*this).view(0, new_place->count()));
151 else if(new_place->count() > this->count())
155 std::as_const(*this).view());
163 void fill(
const ElementType& value);
Definition field_entry_view_matrix.inl:110
Definition field_entry_viewer_matrix.inl:52
Definition field_entry.h:19
Definition field_entry_core.h:15
Definition field_entry.h:76
Definition field_entry_launch.h:9
Definition field_entry_layout.h:24
Definition field_entry_view_matrix.inl:154
Definition field_entry_viewer_matrix.inl:77