54 const size_t num_elements_with_padding,
55 const unsigned int num_data,
56 const unsigned int interleave_width)
60 m_compSize(num_elements_with_padding * num_data),
67 template <
typename TPadding>
70 if (interleave_width != 1)
74 "Number of elements is not divisible by interleave width.");
77 "interleave width should be divisible by AVX vector width.");
142template <
typename TData, FieldState TState>
145 template <
typename TDataField, FieldState TStateField>
friend class Field;
152 const unsigned int num_components,
153 const unsigned int num_homo_modes)
161 const size_t num_elements_with_padding,
162 const unsigned int num_data,
const unsigned interleave_width,
165 const unsigned int num_components,
166 const unsigned int num_homo_modes)
168 num_data, interleave_width),
186 rhs.m_field =
nullptr;
187 rhs.m_num_components = 0;
188 rhs.m_num_homo_modes = 1;
209 m_field = std::move(rhs.m_field);
213 rhs.m_field =
nullptr;
214 rhs.m_num_components = 0;
215 rhs.m_num_homo_modes = 1;
221 const unsigned int &interleaveWidth,
const std::string &execSpace,
222 const unsigned int streamID = 0);
229 template <
typename MemSpace,
typename MemAccess>
232 GetPtr(
const unsigned int streamID = 0);
270 template <
typename MemSpace>
272 const size_t count = 0,
273 const size_t offset = 0,
274 const unsigned int streamID = 0);
283 template <
typename MemSpace>
285 const unsigned int streamID = 0);
#define ASSERTL0(condition, msg)
#define LIB_UTILITIES_EXPORT
Get the BlockAttributes for a given field state from an ExpList. This method basically captures ident...
void Copy(BlockAccessor &rhs, const unsigned int streamID=0)
Templated copy method. This method copies the data of a BlockAccessor of the same size and takes its ...
Field< TData, TState > * m_field
unsigned int GetNumComponents() const
Gets the number of components.
unsigned int m_num_components
BlockAccessor & operator=(const BlockAccessor &)=delete
unsigned int GetNumHomoModes() const
Gets the number of homogeneous modes.
void Initialize(const TData val, const size_t count=0, const size_t offset=0, const unsigned int streamID=0)
initialize the storage memory.
MemoryRegion< TData > m_memory_region
BlockAccessor & operator=(BlockAccessor &&rhs)
Move assignment operator.
void ReshapeStorage(const unsigned int &interleaveWidth, const std::string &execSpace, const unsigned int streamID=0)
BlockAccessor(const size_t num_elements, const size_t num_elements_with_padding, const unsigned int num_data, const unsigned interleave_width, MemoryRegion< TData > &&memory_region, Field< TData, TState > *field, const unsigned int num_components, const unsigned int num_homo_modes)
BlockAccessor(const BlockAccessor &)=delete
Constructor methods - No copy methods.
size_t GetAlignment() const
Gets the alignment of the memory region block.
BlockAccessor(BlockAccessor &&rhs)
Constructor methods - move from another BlockAccessor.
BlockAccessor(const BlockAttributes< TState > blockAttr, MemoryRegion< TData > &&memory_region, Field< TData, TState > *field, const unsigned int num_components, const unsigned int num_homo_modes)
unsigned int m_num_homo_modes
const_if< std::is_same_v< MemAccess, ReadOnly >, TData >::type * GetPtr(const unsigned int streamID=0)
Get the pointer to the host/device memory.
A block means a group of elements of identical shape, basis and order. BlockAttributes stores the mos...
const size_t m_num_elements_with_padding
size_t GetNumPaddingElements(void) const
size_t GetNumElmtGroups(void) const
size_t GetNumElementsWithPadding(void) const
unsigned int GetInterleaveWidth(void) const
const unsigned int m_num_data
size_t CompSize(void) const
BlockAttributes(const size_t num_elements, const size_t num_elements_with_padding, const unsigned int num_data, const unsigned int interleave_width)
BlockAttributes(const BlockAttributes &)=default
unsigned int GetNumData(void) const
unsigned int m_interleave_width
size_t GetNumElements(void) const
const size_t m_num_elements
size_t GetNumElmtGroups(const unsigned int interleave_width) const
void SetInterleaveWidth(const unsigned interleave_width)
A Field represents expansion data to be operated on.
A MemoryRegion represents a memory region.
typename abi< ScalarType, width >::type simd