75 template <
int alignment>
98 template <
typename Element_,
int kElements_,
size_t kAlignment_ = 16>
101 static_assert(kAlignment_ == 16 || kAlignment_ >=
sizeof(Element_),
"Alignment is too small");
118 uint64_t* ptr =
reinterpret_cast<uint64_t*
>(storage);
120 ptr[i] = uint64_t(0);
123 uint32_t* ptr =
reinterpret_cast<uint32_t*
>(storage);
125 ptr[i] = uint32_t(0);
128 uint16_t* ptr =
reinterpret_cast<uint16_t*
>(storage);
130 ptr[i] = uint16_t(0);
144 return reinterpret_cast<Element const*
>(storage)[i];
152 static int const kStorageCount =
167 template <
typename Fragment_,
typename Iterations_,
typename AccessType_>
188 template <
typename OtherFragment_>
225 template <
typename Fragment_,
typename Iterations_,
typename AccessType_>
246 template <
typename OtherFragment_>
CUTLASS_HOST_DEVICE void clear()
Clear a fragment.
Definition: fragment.h:115
CUTLASS_HOST_DEVICE bool valid(int d, int h, int w, int c) const
Is the iterator valid?
Definition: fragment.h:217
Shape< Shape_::kH *Shape_::kW *Shape_::kC, Shape_::kW *Shape_::kC, Shape_::kC, elementsPerAccess > Shape
Definition: shape.h:170
Definition: fragment.h:226
CUTLASS_HOST_DEVICE FragmentIterator(OtherFragment_ &fragment, int offset=0)
Ctor.
Definition: fragment.h:189
A template defining Fragment Concept.
Definition: fragment.h:99
Fragment::Element Element
The element.
Definition: fragment.h:179
static int const kElementsPerAccess
The number of elements per access.
Definition: fragment.h:239
Fragment_ Fragment
The fragment.
Definition: fragment.h:172
Fragment_ Fragment
The fragment.
Definition: fragment.h:230
Fragment::Element Element
The element.
Definition: fragment.h:237
Fragment< Element_, kElements_ > This_
Make sure the alignment makes sense wrt the size of elements.
Definition: fragment.h:101
FragmentIterator< Fragment_, Iterations_, AccessType_ > This_
This class.
Definition: fragment.h:170
ShapeMul< Iterations, Shape< 1, 1, 1, kElementsPerAccess > >::Shape FragmentShape
The shape of the the fragment.
Definition: fragment.h:241
Definition: fragment.h:76
uint32_t Type
Definition: fragment.h:81
uint8_t Type
Definition: fragment.h:89
Element * pointer
The pointer.
Definition: fragment.h:220
CUTLASS_HOST_DEVICE Element const & operator[](int i) const
The accessor.
Definition: fragment.h:143
AccessType_ AccessType
The access type.
Definition: fragment.h:234
ShapeStrides< FragmentShape, kElementsPerAccess >::Shape IterationsStrides
The linear strides for iterations.
Definition: fragment.h:243
ShapeMul< Iterations, Shape< 1, 1, 1, kElementsPerAccess > >::Shape FragmentShape
The shape of the the fragment.
Definition: fragment.h:183
CUTLASS_HOST_DEVICE FragmentConstIterator(OtherFragment_ &fragment, int offset=0)
Ctor.
Definition: fragment.h:247
A template defining Fragment Iterator Concept.
Definition: fragment.h:168
static int const kElements
The number of elements.
Definition: fragment.h:110
#define CUTLASS_HOST_DEVICE
Definition: cutlass.h:46
Iterations_ Iterations
The number of iterations.
Definition: fragment.h:232
CUTLASS_HOST_DEVICE AccessType const & at(int d, int h, int w, int c=0) const
The accessor.
Definition: fragment.h:195
Iterations_ Iterations
The number of iterations.
Definition: fragment.h:174
CUTLASS_HOST_DEVICE FragmentConstIterator(FragmentIterator< Fragment_, Iterations_, AccessType_ > const &rhs_)
Create from non-constant FragmentIterator.
Definition: fragment.h:252
A Shape implementing Layout Concept describing the dimensions of a cube.
Definition: shape.h:64
Element_ Element
The element.
Definition: fragment.h:108
FragmentIterator< Fragment_, Iterations_, AccessType_ > This_
This class.
Definition: fragment.h:228
CUTLASS_HOST_DEVICE AccessType const & operator[](int i) const
The accessor.
Definition: fragment.h:263
CUTLASS_HOST_DEVICE Element & operator[](int i)
The accessor.
Definition: fragment.h:140
CUTLASS_HOST_DEVICE AccessType const & operator[](int i) const
The accessor.
Definition: fragment.h:207
uint16_t Type
Definition: fragment.h:85
Defines a 1D vector of elements held in the registers of each thread.
uint64_t Type
Definition: fragment.h:77
CUTLASS_HOST_DEVICE bool valid(int d, int h, int w, int c) const
Is the iterator valid?
Definition: fragment.h:268
ShapeStrides< FragmentShape, kElementsPerAccess >::Shape Strides
The linear strides for iterations.
Definition: fragment.h:185
static CUTLASS_HOST_DEVICE int get(int d, int h, int w, int c)
Definition: shape.h:199
CUTLASS_HOST_DEVICE AccessType & operator[](int i)
The accessor.
Definition: fragment.h:212
CUTLASS_HOST_DEVICE AccessType & at(int d, int h, int w, int c=0)
The accessor.
Definition: fragment.h:201
static int const kElementsPerAccess
The number of elements per access.
Definition: fragment.h:181
Defines Shape implementing the Layout concept for representing a 4D hypercube of objects.
AccessType_ AccessType
The access type.
Definition: fragment.h:176
static int const kAlignment
Alignment.
Definition: fragment.h:112
Definition: cutlass_math.h:45
CUTLASS_HOST_DEVICE AccessType const & at(int d, int h, int w, int c=0) const
The accessor.
Definition: fragment.h:257
Element const * pointer
The pointer.
Definition: fragment.h:271