Skip to content

strata::Aligned

Part of Memory.

template <std::size_t N = default_alignment>
struct strata::Aligned;

A memory policy for tensors: memory aligned to N bytes, which strata places itself.

Small static tensors keep their elements inside the object, aligned to at most N; everything else comes from AlignedAllocator<T, N>. The policy names no element type, as layout policies name no shape.

Template parameters

Name Description
N A power of two.

Members

allocator

template <typename T>
using strata::Aligned< N >::allocator = AlignedAllocator<T, N>

The allocator for elements of type T.

alignment

static constexpr std::size_t alignment = N

The alignment of the memory, in bytes.