46 static int const kCount = Contiguous * Strided;
166 static int const kRank = 2;
169 static int const kStrideRank = 1;
221 Index(index % stride_[0]),
222 Index(index / stride_[0])
241 return stride_[rank];
247 return stride_[rank];
253 return extent.
strided() * stride_[0];
int Index
Integer-valued index.
Definition: pitch_linear.h:56
static int const kCount
Definition: pitch_linear.h:46
Definition: aligned_buffer.h:35
Coordinate in pitch-linear space.
Definition: pitch_linear.h:52
CUTLASS_HOST_DEVICE PitchLinearCoord operator-(Base const &b) const
Element-wise subtraction.
Definition: pitch_linear.h:115
Mapping function for pitch-linear memory.
Definition: pitch_linear.h:163
A Coord is a coordinate of arbitrary rank into a tensor or matrix.
CUTLASS_HOST_DEVICE Coord< 1 > make_Coord(int _0)
Helper to make a 2-element coordinate.
Definition: coord.h:387
CUTLASS_HOST_DEVICE Stride stride() const
Returns the stride of the layout.
Definition: pitch_linear.h:228
static CUTLASS_HOST_DEVICE PitchLinear packed(TensorCoord const &extent)
Helper returns a layout to a tightly packed tensor.
Definition: pitch_linear.h:206
CUTLASS_HOST_DEVICE half_t & operator/=(half_t &lhs, half_t const &rhs)
Definition: half.h:684
CUTLASS_HOST_DEVICE half_t & operator+=(half_t &lhs, half_t const &rhs)
Definition: half.h:654
Template defining a shape used by pitch-linear operators.
Definition: pitch_linear.h:43
CUTLASS_HOST_DEVICE half_t & operator-=(half_t &lhs, half_t const &rhs)
Definition: half.h:664
int64_t LongIndex
Long index type used for offsets.
Definition: pitch_linear.h:175
CUTLASS_HOST_DEVICE PitchLinearCoord & operator+=(Base const &b)
In-place addition.
Definition: pitch_linear.h:133
CUTLASS_HOST_DEVICE PitchLinear(Stride _stride)
Constructor.
Definition: pitch_linear.h:202
static int const kStrided
Definition: pitch_linear.h:45
CUTLASS_HOST_DEVICE PitchLinearCoord & operator*=(Base const &b)
In-place multiplication.
Definition: pitch_linear.h:147
static int const kContiguous
Definition: pitch_linear.h:44
CUTLASS_HOST_DEVICE TensorCoord inverse(LongIndex index) const
Returns the logical coordinate given an offset.
Definition: pitch_linear.h:219
CUTLASS_HOST_DEVICE Index & stride(int rank)
Returns the stride of the layout.
Definition: pitch_linear.h:246
CUTLASS_HOST_DEVICE Stride & stride()
Returns the stride of the layout.
Definition: pitch_linear.h:234
#define CUTLASS_HOST_DEVICE
Definition: cutlass.h:89
CUTLASS_HOST_DEVICE Index const & contiguous() const
Returns the contiguous dimension.
Definition: pitch_linear.h:89
CUTLASS_HOST_DEVICE PitchLinearCoord(Index contiguous_, Index strided_)
Helper to construct from a row and column.
Definition: pitch_linear.h:85
int32_t Index
Index type used for coordinates.
Definition: pitch_linear.h:172
CUTLASS_HOST_DEVICE half_t & operator*=(half_t &lhs, half_t const &rhs)
Definition: half.h:674
Statically-sized array specifying Coords within a tensor.
Definition: coord.h:43
CUTLASS_HOST_DEVICE LongIndex operator()(TensorCoord const &coord) const
Definition: pitch_linear.h:213
CUTLASS_HOST_DEVICE PitchLinearCoord & operator/=(Base const &b)
In-place division.
Definition: pitch_linear.h:154
CUTLASS_HOST_DEVICE Index stride(int rank) const
Returns the stride of the layout.
Definition: pitch_linear.h:240
CUTLASS_HOST_DEVICE PitchLinear(Index ldm=0)
Constructor.
Definition: pitch_linear.h:198
CUTLASS_HOST_DEVICE Index & strided()
Returns the column of the coordinate.
Definition: pitch_linear.h:101
CUTLASS_HOST_DEVICE PitchLinearCoord operator/(Base const &b) const
Element-wise division.
Definition: pitch_linear.h:127
CUTLASS_HOST_DEVICE PitchLinearCoord operator*(Base const &b) const
Element-wise multiplication.
Definition: pitch_linear.h:121
CUTLASS_HOST_DEVICE PitchLinearCoord(Coord< 2, Index > const &coord)
Constructs from Coord<2>
Definition: pitch_linear.h:81
CUTLASS_HOST_DEVICE PitchLinearCoord operator+(Base const &b) const
Element-wise addition.
Definition: pitch_linear.h:109
CUTLASS_HOST_DEVICE Index & contiguous()
Returns the contiguous dimension.
Definition: pitch_linear.h:93
CUTLASS_HOST_DEVICE PitchLinearCoord()
Default ctor.
Definition: pitch_linear.h:77
Basic include for CUTLASS.
CUTLASS_HOST_DEVICE PitchLinearCoord & operator-=(Base const &b)
In-place subtraction.
Definition: pitch_linear.h:140
CUTLASS_HOST_DEVICE Index const & strided() const
Returns the column of the coordinate.
Definition: pitch_linear.h:97
CUTLASS_HOST_DEVICE LongIndex capacity(TensorCoord const &extent) const
Compute the number of contiguous elements needed to store a tensor with the given size...
Definition: pitch_linear.h:252