Skip to main content

Overview

Layout functions define how logical coordinates in a tensor’s index space map to offsets in the 1D array held in memory. All layout functions implement the interface defined by IdentityTensorLayout<> and are used by TensorRef and derived classes. Header: cutlass/layout/matrix.h

RowMajor

Mapping function for row-major matrices.

Class Definition

Constructors

Member Functions

packed

Returns a layout to a tightly packed tensor.

operator()

Returns the offset of a coordinate in linear memory. Assumes coordinate has convention (row, column). Implementation:

inverse

Inverse of layout function, mapping linear offset to logical coordinate.

stride

capacity

Computes the number of contiguous elements needed to store a tensor with the given size.

Example

ColumnMajor

Mapping function for column-major matrices.

Class Definition

Constructors

Member Functions

packed

operator()

Returns the offset of a coordinate in linear memory. Implementation:

inverse

stride

capacity

Example

RowMajorInterleaved

Mapping function for interleaved matrices. Matrix is structured as row-major arrangement of fixed-size columns.

Template Signature

Template Parameters

int
Size of interleaved columns

Class Definition

operator()

Implementation:

Example

ColumnMajorInterleaved

Mapping function for interleaved matrices. Matrix is structured as column-major arrangement of fixed-size rows.

Template Signature

Template Parameters

int
Size of interleaved rows

Class Definition

operator()

Implementation:

ContiguousMatrix

Mapping function for scenarios where layout is row-major or column-major but this information is only available at runtime.

Enumeration

Class Definition

Constructor

operator()

Implementation:

Example

AffineRank2ColumnMajor

Mapping function for scenarios where both rows and columns are separated by a stride. Row stride is smaller than column stride.

Class Definition

Constructors

operator()

Implementation:

AffineRank2RowMajor

Mapping function where both rows and columns are separated by a stride. Column stride is smaller than row stride.

Class Definition

Constructors

Layout Transpose

Defines transposes of matrix layouts.

Example

See Also

  • TensorRef - Uses layout functions to map coordinates
  • Gemm - Accepts layout template parameters