layout

Supported Products

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

x

Atlas inference product's AI Core

x

Atlas inference product's Vector Core

x

Atlas training products

x

Functions

Obtains the layout instantiation object.

Prototype

1
2
__aicore__ inline constexpr decltype(auto) layout() {}
__aicore__ inline constexpr decltype(auto) layout() const {}

Command-Line Options

None

Return Value Description

The layout instantiation object is returned.

Restrictions

The Shape and Stride structures passed to the constructor of the Layout object must be of the Std::tuple structure type and meet the usage restrictions of the Std::tuple structure type.

Examples

1
2
3
4
5
6
7
AscendC::Shape<int,int,int> shape = AscendC::MakeShape(10, 20, 30);
AscendC::Stride<int,int,int> stride = AscendC::MakeStride(1, 100, 200);

AscendC::Layout<AscendC::Shape<int, int, int>, AscendC::Stride<int, int, int>> layoutInit(shape, stride);

// Use the layout function to obtain the instantiation object.
constexpr auto& layout = layoutInit.layout();