80 typename MapFunc_ = IdentityTensorMapFunc<Rank_>,
82 int StorageRank_ = MapFunc_::kStorageRank,
84 typename Index_ = int,
86 typename LongIndex_ =
long long 89 public TensorRef<Storage_, Rank_, MapFunc_, StorageRank_, Index_, LongIndex_> {
139 ref.add_pointer_offset(offset_);
202 return offset_ - it.offset_;
264 typename MapFunc_ = IdentityTensorMapFunc<Rank_>,
266 int StorageRank_ = MapFunc_::kStorageRank,
268 typename Index_ = int,
270 typename LongIndex_ =
long long 315 return ref_.reference(idx_);
406 stride[i] = stride_[idx][i];
Constant iterator over tensors implied by TensorRefBatchStrided.
Definition: tensor_ref_collection.h:114
CUTLASS_HOST_DEVICE ConstIterator & operator--()
Moves to the previous tensor.
Definition: tensor_ref_collection.h:173
Defines a structure containing strides, bounds, and a pointer to tensor data.
CUTLASS_HOST_DEVICE ConstIterator & operator--()
Definition: tensor_ref_collection.h:345
Index * strides[kStorageRank - 1]
Array of strides.
Definition: tensor_ref_collection.h:378
Storage_ Storage
Element pointed to by the TensorRef.
Definition: tensor_ref_collection.h:281
Definition: tensor_ref_collection.h:272
static int const kStorageRank
Rank of the stride vector.
Definition: tensor_ref_collection.h:290
Base::Storage Storage
Storage type.
Definition: tensor_ref_collection.h:99
CUTLASS_HOST_DEVICE ConstIterator & operator-=(Index idx)
Definition: tensor_ref_collection.h:359
LongIndex_ LongIndex
Typically, strides in memory can be very large.
Definition: tensor_ref_collection.h:287
CUTLASS_HOST_DEVICE ConstIterator begin()
Returns an iterator.
Definition: tensor_ref_collection.h:243
LongIndex tensor_stride
Stride between tensors.
Definition: tensor_ref_collection.h:211
CUTLASS_HOST_DEVICE ConstIterator operator++(int)
Advances the iterator to point to the next tensor.
Definition: tensor_ref_collection.h:152
Base TensorRef
Tensor reference implied by the TensorRefBatchStrided.
Definition: tensor_ref_collection.h:111
CUTLASS_HOST_DEVICE TensorRef * operator() const
Obtains a TensorRef pointed to by the iterator.
Definition: tensor_ref_collection.h:137
CUTLASS_HOST_DEVICE ConstIterator operator--(int)
Moves to the previous tensor.
Definition: tensor_ref_collection.h:180
CUTLASS_HOST_DEVICE ConstIterator begin()
Returns an TesnorRefIterator over the TensorRef objects in this collection.
Definition: tensor_ref_collection.h:413
TensorRefIterator over TensorRef objects in TensorRefArray.
Definition: tensor_ref_collection.h:293
Index_ Index
Index type.
Definition: tensor_ref.h:146
#define CUTLASS_PRAGMA_UNROLL
Definition: cutlass.h:62
CUTLASS_HOST_DEVICE ConstIterator(TensorArrayRef const &ref, int idx=0)
Constructs a ConstIterator over the TensorRef objects.
Definition: tensor_ref_collection.h:310
TensorRef< Storage_, Rank_, MapFunc_, StorageRank_, Index_, LongIndex_ > TensorRef
TensorRef type obtained from the TensorRefArray.
Definition: tensor_ref_collection.h:278
Index_ Index
Index type.
Definition: tensor_ref_collection.h:284
CUTLASS_HOST_DEVICE ConstIterator operator-(Index idx)
Definition: tensor_ref_collection.h:365
LongIndex_ LongIndex
Typically, strides in memory can be very large.
Definition: tensor_ref.h:149
CUTLASS_HOST_DEVICE ConstIterator operator--(int)
Advances to next TensorRef.
Definition: tensor_ref_collection.h:352
CUTLASS_HOST_DEVICE Stride operator-(ConstIterator const &it)
Returns the difference in offset between two iterators.
Definition: tensor_ref_collection.h:201
CUTLASS_HOST_DEVICE TensorRef * operator() const
Obtains a TensorRef pointed to by this iterator.
Definition: tensor_ref_collection.h:314
CUTLASS_HOST_DEVICE TensorRef at(Index idx) const
Definition: tensor_ref_collection.h:402
LongIndex_ LongIndex
Typically, strides in memory can be very large.
Definition: tensor_ref_collection.h:105
static int const kStorageRank
Rank of internal storage.
Definition: tensor_ref.h:143
Coord< kRank > TensorCoord
Coordinate in logical tensor space.
Definition: tensor_ref_collection.h:108
CUTLASS_HOST_DEVICE TensorRef at(Index idx) const
Definition: tensor_ref_collection.h:235
CUTLASS_HOST_DEVICE ConstIterator operator-(Index idx)
Returns an iterator moved forward by (idx) amount.
Definition: tensor_ref_collection.h:188
#define CUTLASS_HOST_DEVICE
Definition: cutlass.h:46
CUTLASS_HOST_DEVICE TensorRefBatchStrided()
Definition: tensor_ref_collection.h:219
CUTLASS_HOST_DEVICE LongIndex offset(TensorCoord const &coord) const
Computes the offset of an index from the origin of the tensor.
Definition: tensor_ref.h:331
Statically-sized array specifying Coords within a tensor.
Definition: coord.h:49
Index_ Index
Index type.
Definition: tensor_ref_collection.h:102
CUTLASS_HOST_DEVICE ConstIterator operator+(Index idx)
Returns an iterator advanced by (idx) amount.
Definition: tensor_ref_collection.h:160
CUTLASS_HOST_DEVICE ConstIterator & operator+=(Index idx)
Advances this iterator by (idx) and returns a reference to self.
Definition: tensor_ref_collection.h:166
Storage ** pointers
Base addresses.
Definition: tensor_ref_collection.h:375
CUTLASS_HOST_DEVICE LongIndex get_pointer_offset(Index idx) const
Gets the pointer offset.
Definition: tensor_ref_collection.h:229
Definition: tensor_ref_collection.h:88
CUTLASS_HOST_DEVICE ConstIterator operator+(Index idx)
Definition: tensor_ref_collection.h:334
CUTLASS_HOST_DEVICE ConstIterator & operator-=(Index idx)
Moves this iterator by (idx) and returns a reference to self.
Definition: tensor_ref_collection.h:194
Base TensorRef
TensorRef returned by the iterator.
Definition: tensor_ref_collection.h:117
CUTLASS_HOST_DEVICE TensorRefBatchStrided(TensorRef const &ref, LongIndex _tensor_stride=0)
Definition: tensor_ref_collection.h:223
CUTLASS_HOST_DEVICE ConstIterator & operator+=(Index idx)
Definition: tensor_ref_collection.h:339
CUTLASS_HOST_DEVICE ConstIterator(TensorRefBatchStrided const &ref, LongIndex offset=0)
Constructs a ConstIterator from a parent TensorRefBatchStrided.
Definition: tensor_ref_collection.h:131
CUTLASS_HOST_DEVICE ConstIterator & operator++()
Advances the iterator to point to the next tensor.
Definition: tensor_ref_collection.h:145
TensorRef< Storage_, Rank_, MapFunc_, StorageRank_, Index_, LongIndex_ > Base
Underlying TensorRef type.
Definition: tensor_ref_collection.h:96
CUTLASS_HOST_DEVICE TensorArrayRef()
Definition: tensor_ref_collection.h:386
CUTLASS_HOST_DEVICE ConstIterator & operator++()
Advances to next TensorRef.
Definition: tensor_ref_collection.h:320
CUTLASS_HOST_DEVICE TensorArrayRef(Storage **_pointers, Index _strides[kStorageRank - 1])
Definition: tensor_ref_collection.h:390
Base TensorRef
TensorRef returned by the iterator.
Definition: tensor_ref_collection.h:297
CUTLASS_HOST_DEVICE ConstIterator operator++(int)
Advances to next TensorRef.
Definition: tensor_ref_collection.h:327