3MUDA_INLINE
void SubFieldImpl<FieldEntryLayout::AoSoA>::build_impl()
5 auto min_alignment = build_options().min_alignment;
6 auto max_alignment = build_options().max_alignment;
22 uint32_t struct_stride = 0;
23 for(
auto& e : m_entries)
26 auto elem_byte_size = e->elem_byte_size();
28 auto inner_array_size = e->layout_info().innermost_array_size();
32 struct_stride = align(struct_stride, elem_byte_size, min_alignment, max_alignment);
34 e->m_core.m_info.offset_in_struct = struct_stride;
36 auto total_elem_count_in_innermost_array = e->shape().x * e->shape().y * inner_array_size;
37 struct_stride += elem_byte_size * total_elem_count_in_innermost_array;
40 m_struct_stride = align(struct_stride, struct_stride, min_alignment, max_alignment);
42 for(
auto& e : m_entries)
44 e->m_core.m_info.struct_stride = m_struct_stride;
48MUDA_INLINE
size_t SubFieldImpl<FieldEntryLayout::AoSoA>::require_total_buffer_byte_size(
size_t element_count)
50 size_t outer_size = round_up(element_count, m_layout_info.innermost_array_size());
51 return outer_size * m_struct_stride;