Visible to Intel only — GUID: GUID-4DC8785C-4476-4EF9-969A-84DEE687B7DC
Visible to Intel only — GUID: GUID-4DC8785C-4476-4EF9-969A-84DEE687B7DC
soa1d_container
Template class for "Structure of Arrays" memory layout of a one-dimensional container of Primitives. #include <sdlt/soa1d_container.h>
Syntax
template<typename PrimitiveT,
int AlignD1OnIndexT = 0,
class AllocatorT = allocator::default_alloc>
class soa1d_container;
Arguments
typename PrimitiveT |
The type that each element in the array will store |
int AlignD1OnIndexT = 0 |
[Optional] The index on which the data access will be aligned (useful for stencils) |
class AllocatorT = allocator::default_alloc |
[Optional] Specify type of allocator to be used. allocator::default_alloc is currently the only allocator supported. |
Description
Dynamically sized container of Primitive elements with memory layout as a Structure of Arrays internally providing:
- Dynamic resizing with interface similar to std::vector
- Accessor objects suitable for efficient data access inside SIMD loops
Member |
Description |
---|---|
|
Type to use when specifying sizes to methods of the container. |
|
Template alias to an accessor for this container |
|
Template alias to an const_accessor for this container |
Member Type |
Description |
---|---|
|
Constructs an uninitialized container of size_d1 elements, using optionally specified allocator instance, using optionally specified number of cache lines to offset the start of the buffer in memory to allow management of 4k cache aliasing. |
|
Constructs a container of size_d1 elements initializing each with a_value, using optionally specified allocator instance, using optionally specified number of cache lines to offset the start of the buffer in memory to allow management of 4k cache aliasing. |
|
Constructs a container with a copy of each of the elements in other, in the same order, using optionally specified allocator instance, using optionally specified number of cache lines to offset the start of the buffer in memory to allow management of 4k cache aliasing. |
|
Constructs a container with a copy of number_of_elements elements from the array other_array, in the same order, using optionally specified allocator instance, using optionally specified number of cache lines to offset the start of the buffer in memory to allow management of 4k cache aliasing. |
|
Constructs a container with as many elements as the range [a_begin - an_end), each with a copy of the value from its corresponding element in that range, in the same order, using optionally specified allocator instance, using optionally specified number of cache lines to offset the start of the buffer in memory to allow management of 4k cache aliasing. |
|
Returns: a new soa1d_container instance with its own copy of the elements |
|
Resize the container so that it contains new_size_d1 elements. If the new size is greater than the current container size, the new elements are unitialized. |
|
Returns: accessor with no embedded index offset. |
|
Returns: accessor with an integer based embedded index offset. |
|
Returns: accessor with an aligned_offset<IndexAlignmentT> based embedded index offset. |
|
Returns: accessor with a fixed_offset<OffsetT> based embedded index offset. |
|
Returns: const_accessor with no embedded index offset. |
|
Returns: const_accessor with an integer based embedded index offset. |
|
Returns: const_accessor with an aligned_offset<IndexAlignmentT> based embedded index offset. |
|
Returns: const_accessor with a fixed_offset<OffsetT> based embedded index offset. |
STL Compatibility
In addition to the performance oriented interface explained in the table above, soa1d_container implements a subset of the std::vector interface that is intended for ease of integration, not high performance. Due to the import/export only requirement we can’t return a reference to the object, instead iterators and operator[] return a Proxy object while other "const' methods return a "value_type const". Futhermore, iterators do not support the -> operator. Despite that limitation the iterators can be passed to any STL algorithm. Also for performance reasons, resize does not initialize new elements. The following std::vector interface methods are implemented:
size, max_size, capacity, empty, reserve, shrink_to_fit
assign, push_back, pop_back, clear, insert, emplace, erase
cbegin, cend, begin, end, begin, end, crbegin, crend, rbegin, rend, rbegin, rend
operator[], front() const, back() const, at() const
swap, ==, !=
swap, soa1d_container(soa1d_container&& donor), soa1d_container & operator=(soa1d_container&& donor)