AI Engine API User Guide (AIE-API) 2026.1
Loading...
Searching...
No Matches
aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps > Class Template Reference

#include <iterator.hpp>

Public Types

using type = T
using vector_type = detail::tensor_desc_type_t<T, Elems>

Public Member Functions

constexpr tensor_descriptor ()=default
constexpr tensor_descriptor (const contiguous_dim &dim)
constexpr tensor_descriptor (const std::array< tensor_dim, Rank > &dims)
constexpr tensor_descriptor (const tensor_descriptor &other)

Static Public Attributes

static constexpr unsigned elems = Elems
static constexpr bool has_innermost_sliding_dim
static constexpr unsigned num_levels = std::tuple_size_v<Repr>

Member Typedef Documentation

◆ type

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
using aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps >::type = T

◆ vector_type

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
using aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps >::vector_type = detail::tensor_desc_type_t<T, Elems>

Constructor & Destructor Documentation

◆ tensor_descriptor() [1/4]

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps >::tensor_descriptor ( )
constexprdefault

◆ tensor_descriptor() [2/4]

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps >::tensor_descriptor ( const std::array< tensor_dim, Rank > & dims)
inlineexplicitconstexpr

◆ tensor_descriptor() [3/4]

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps >::tensor_descriptor ( const contiguous_dim & dim)
inlineexplicitconstexpr

◆ tensor_descriptor() [4/4]

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps >::tensor_descriptor ( const tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps > & other)
inlineconstexpr

◆ detail::make_tensor_buffer_stream [1/2]

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
template<typename ResourceType, ResourceType Resource, tbs_mode Mode, bool Restrict, typename StreamType, typename MemType, typename Desc>
auto detail::make_tensor_buffer_stream ( StreamType * stream_ptr,
MemType * mem_ptr,
const Desc & desc )
friend

◆ detail::make_tensor_buffer_stream [2/2]

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
template<typename ResourceType, ResourceType Resource, tbs_mode Mode, bool Restrict, bool Unaligned, typename T2, typename Desc>
auto detail::make_tensor_buffer_stream ( T2 && src,
const Desc & desc )
friend

◆ make_restrict_tensor_buffer_stream

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
template<aie_dm_resource Resource, tbs_mode Mode, DecoratedElemBaseOrBlockType T2, typename TensorDescriptor>
requires (arch::is(arch::Gen2))
auto make_restrict_tensor_buffer_stream ( T2 * base,
const TensorDescriptor & dims )
friend

◆ make_tensor_buffer_stream [1/2]

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
template<aie_dm_resource Resource, tbs_mode Mode, DecoratedElemBaseOrBlockType T2, typename TensorDescriptor>
requires (arch::is(arch::Gen2))
auto make_tensor_buffer_stream ( const T2 * base,
const TensorDescriptor & dims )
friend

◆ make_tensor_buffer_stream [2/2]

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
template<aie_dm_resource Resource, tbs_mode Mode, DecoratedElemBaseOrBlockType T2, typename TensorDescriptor>
requires (arch::is(arch::Gen2))
auto make_tensor_buffer_stream ( T2 * base,
const TensorDescriptor & dims )
friend

◆ make_tensor_descriptor_from_native

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
template<typename T2, unsigned Elems2, data_layout Layout2, NativeDim... Args>
requires (arch::is(arch::Gen2))
auto make_tensor_descriptor_from_native ( Args &&... args)
friend

Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream.

Template Parameters
TType of the elements in the described tensor.
ElemsSize of the vector used as part of the tensor descriptor.
LayoutThe memory order of the tensor.
Parameters
argsA pack of native dim types which describe the multidimensional increments,

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

See also
aie::dim_2d, aie::dim_3d
Template Parameters
MAn aie::mask<N> type
LayoutThe memory order of the tensor.
Parameters
argsA pack of native dim types which describe the multidimensional increments,

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

See also
aie::dim_2d, aie::dim_3d

◆ make_tensor_descriptor_from_native_bytes

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
template<typename T2, unsigned Elems2, data_layout Layout2, NativeOrSlidingDim... Args>
requires (arch::is(arch::Gen2))
auto make_tensor_descriptor_from_native_bytes ( Args &&... args)
friend

Creates a tensor descriptor from native dim types (int, dim_2d, dim_3d) that is to be used to create a tensor buffer stream.

Template Parameters
TType of the elements in the described tensor.
ElemsSize of the vector used as part of the tensor descriptor.
LayoutThe memory order of the tensor.
Parameters
argsA pack of native dim types which describe the multidimensional increments, in units of bytes,

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

See also
aie::dim_2d, aie::dim_3d
Template Parameters
MAn aie::mask<N> type
LayoutThe memory order of the tensor.
Parameters
argsA pack of native dim types which describe the multidimensional increments, in units of bytes,

AIE hardware is limited to 3D addressing and therefore tensors of higher rank are partitioned into nested tensor buffer streams. The default partitioning for a rank N tensor is (N/3)x3D + 1x(N%3)D. For example, a 5D tensor buffer stream will be represented as an outer 3D tensor buffer stream with an inner 2D tensor buffer stream.

See also
aie::dim_2d, aie::dim_3d

Member Data Documentation

◆ elems

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
unsigned aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps >::elems = Elems
staticconstexpr

◆ has_innermost_sliding_dim

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
bool aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps >::has_innermost_sliding_dim
staticconstexpr
Initial value:
= detail::utils::is_one_of_v<std::tuple_element_t<num_levels - 1, Repr>,
static constexpr unsigned num_levels
Definition iterator.hpp:1770
detail::sliding_window_dim_3d sliding_window_dim_3d
Definition iterator.hpp:1741
detail::sliding_window_dim_1d sliding_window_dim_1d
Definition iterator.hpp:1739
detail::sliding_window_dim_2d sliding_window_dim_2d
Definition iterator.hpp:1740

◆ num_levels

template<unsigned Rank, typename T, unsigned Elems, data_layout Layout = data_layout::row_major, typename Repr = detail::default_repr_t<Rank>, bool ByteSteps = false>
unsigned aie::tensor_descriptor< Rank, T, Elems, Layout, Repr, ByteSteps >::num_levels = std::tuple_size_v<Repr>
staticconstexpr

The documentation for this class was generated from the following file: