CUDA Templates for Linear Algebra Subroutines and Solvers
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
cutlass::layout::ContiguousMatrix Struct Reference

#include <matrix.h>

Public Types

using Index = int32_t
 Index type used for coordinates. More...
using LongIndex = int64_t
 Long index type used for offsets. More...
using TensorCoord = MatrixCoord
 Logical coordinate. More...
using Stride = Coord< kStrideRank, Index >
 Stride vector. More...

Public Member Functions

CUTLASS_HOST_DEVICE ContiguousMatrix (Index ldm=0, Matrix layout=Matrix::kColumnMajor)
 Ctor. More...
CUTLASS_HOST_DEVICE LongIndex operator() (MatrixCoord const &coord) const
CUTLASS_HOST_DEVICE MatrixCoord inverse (LongIndex offset) const
 Inverse of layout function, mapping linear offset to logical coordinate. More...
CUTLASS_HOST_DEVICE Stride stride () const
 Returns the stride of the layout. More...
 Returns the stride of the layout. More...
CUTLASS_HOST_DEVICE Index stride (int idx) const
 Returns the stride of the layout. More...
CUTLASS_HOST_DEVICE Indexstride (int idx)
 Returns the stride of the layout. More...
CUTLASS_HOST_DEVICE LongIndex capacity (MatrixCoord const &extent) const
 Compute the number of contiguous elements needed to store a tensor with the given size. More...

Static Public Member Functions

static CUTLASS_HOST_DEVICE ContiguousMatrix packed (MatrixCoord const &extent, Matrix layout=Matrix::kColumnMajor)
 Helper returns a layout to a tightly packed tensor. More...

Static Public Attributes

static int const kRank = 2
 Logical rank of tensor. More...
static int const kStrideRank = 1
 Rank of stride vector. More...

Detailed Description

Mapping function for scenario in which layout is row-major or column-major but this information is only available at runtime.

Member Typedef Documentation

Constructor & Destructor Documentation

CUTLASS_HOST_DEVICE cutlass::layout::ContiguousMatrix::ContiguousMatrix ( Index  ldm = 0,
Matrix  layout = Matrix::kColumnMajor 

Member Function Documentation

CUTLASS_HOST_DEVICE LongIndex cutlass::layout::ContiguousMatrix::capacity ( MatrixCoord const &  extent) const
CUTLASS_HOST_DEVICE MatrixCoord cutlass::layout::ContiguousMatrix::inverse ( LongIndex  offset) const
CUTLASS_HOST_DEVICE LongIndex cutlass::layout::ContiguousMatrix::operator() ( MatrixCoord const &  coord) const

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

static CUTLASS_HOST_DEVICE ContiguousMatrix cutlass::layout::ContiguousMatrix::packed ( MatrixCoord const &  extent,
Matrix  layout = Matrix::kColumnMajor 
CUTLASS_HOST_DEVICE Stride cutlass::layout::ContiguousMatrix::stride ( ) const
CUTLASS_HOST_DEVICE Stride& cutlass::layout::ContiguousMatrix::stride ( )
CUTLASS_HOST_DEVICE Index cutlass::layout::ContiguousMatrix::stride ( int  idx) const
CUTLASS_HOST_DEVICE Index& cutlass::layout::ContiguousMatrix::stride ( int  idx)

Member Data Documentation

int const cutlass::layout::ContiguousMatrix::kRank = 2
int const cutlass::layout::ContiguousMatrix::kStrideRank = 1

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