cutlass::TensorRef< Storage_, Rank_ > Class Template Reference

Structure modeling a pointer and stride into a tensor.

`#include <tensor_ref.h>`

## Public Types

typedef Storage_ | Storage
| Data type of individual access. More...

## Public Member Functions

CUTLASS_HOST_DEVICE | TensorRef ()
| Default ctor. More...
CUTLASS_HOST_DEVICE | TensorRef (Storage *ptr, Coord< Rank > stride)
| Constructs from a pointer, size, and stride. More...
CUTLASS_HOST_DEVICE void | reset (Storage *ptr=nullptr, Coord< Rank > stride=Coord< Rank >(0))
| Updates the pointer, stride, and location within a TensorRef. More...
template<typename T >
TensorRef< T, Rank > | convert ()
| Conversion function. More...
CUTLASS_HOST_DEVICE bool | good () const
| Returns true if the TensorRef may be safely accessed. More...
CUTLASS_HOST_DEVICE Storage * | data () const
| Returns the pointer to referenced data. More...
CUTLASS_HOST_DEVICE Coord< Rank > const & | stride () const
| Returns the stride of the tensor. More...
CUTLASS_HOST_DEVICE int const & | stride (int dim) const
| Returns the stride of the tensor in the given dimension. More...
CUTLASS_HOST_DEVICE int | leading_dim () const
| Returns the maximum stride element as the 'leading dimension'. More...
CUTLASS_HOST_DEVICE long long | offset (Coord< Rank > const &coord) const
| Computes the offset of an index from the origin of the tensor. More...
CUTLASS_HOST_DEVICE Storage & | at (Coord< Rank > const &coord) const
| Returns a reference to the element at a given Coord. More...
Storage & | operator[] (Coord< Rank > const &coord) const
| Element-wise accessor. More...
CUTLASS_HOST_DEVICE Storage & | at (int idx) const
| Returns a reference to the element at a given Coord. More...
Storage & | operator[] (int idx) const
| Element-wise accessor. More...
CUTLASS_HOST_DEVICE TensorRef & | advance (Coord< Rank > const &b)
| Adds an offset to the pointer. More...
CUTLASS_HOST_DEVICE TensorRef | operator+ (Coord< Rank > const &b) const
| Returns a TensorRef offset by a given amount. More...
CUTLASS_HOST_DEVICE TensorRef | operator- (Coord< Rank > const &b) const
| Returns a TensorRef offset by a given amount. More...

## Static Public Attributes

static int const | Rank = Rank_
| Rank of tensor. More...

## Member Typedef Documentation

## Storage

template<typename Storage_, int Rank_>

typedef Storage_ cutlass::TensorRef< Storage_, Rank_ >::Storage

## Constructor & Destructor Documentation

## TensorRef() [1/2]

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE cutlass::TensorRef< Storage_, Rank_ >::TensorRef | ( |  | ) |

inline

## TensorRef() [2/2]

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE cutlass::TensorRef< Storage_, Rank_ >::TensorRef | ( | Storage * | ptr,
|  | Coord< Rank > | stride
| ) |  |

inline

## Member Function Documentation

## advance()

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE TensorRef& cutlass::TensorRef< Storage_, Rank_ >::advance | ( | Coord< Rank > const & | b | ) |

inline

## at() [1/2]

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE Storage& cutlass::TensorRef< Storage_, Rank_ >::at | ( | Coord< Rank > const & | coord | ) | const

inline

## at() [2/2]

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE Storage& cutlass::TensorRef< Storage_, Rank_ >::at | ( | int | idx | ) | const

inline

## convert()

template<typename Storage_, int Rank_>
template<typename T >

TensorRef<T, Rank> cutlass::TensorRef< Storage_, Rank_ >::convert | ( |  | ) |

inline

## data()

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE Storage* cutlass::TensorRef< Storage_, Rank_ >::data | ( |  | ) | const

inline

## good()

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE bool cutlass::TensorRef< Storage_, Rank_ >::good | ( |  | ) | const

inline

## leading_dim()

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE int cutlass::TensorRef< Storage_, Rank_ >::leading_dim | ( |  | ) | const

inline

## offset()

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE long long cutlass::TensorRef< Storage_, Rank_ >::offset | ( | Coord< Rank > const & | coord | ) | const

inline

## operator+()

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE TensorRef cutlass::TensorRef< Storage_, Rank_ >::operator+ | ( | Coord< Rank > const & | b | ) | const

inline

## operator-()

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE TensorRef cutlass::TensorRef< Storage_, Rank_ >::operator- | ( | Coord< Rank > const & | b | ) | const

inline

## operator[]() [1/2]

template<typename Storage_, int Rank_>

Storage& cutlass::TensorRef< Storage_, Rank_ >::operator[] | ( | Coord< Rank > const & | coord | ) | const

inline

## operator[]() [2/2]

template<typename Storage_, int Rank_>

Storage& cutlass::TensorRef< Storage_, Rank_ >::operator[] | ( | int | idx | ) | const

inline

## reset()

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE void cutlass::TensorRef< Storage_, Rank_ >::reset | ( | Storage * | ptr = `nullptr`,
|  | Coord< Rank > | stride = `Coord<Rank>(0)`
| ) |  |

inline

## stride() [1/2]

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE Coord<Rank> const& cutlass::TensorRef< Storage_, Rank_ >::stride | ( |  | ) | const

inline

## stride() [2/2]

template<typename Storage_, int Rank_>

CUTLASS_HOST_DEVICE int const& cutlass::TensorRef< Storage_, Rank_ >::stride | ( | int | dim | ) | const

inline

## Member Data Documentation

## Rank

template<typename Storage_, int Rank_>

int const cutlass::TensorRef< Storage_, Rank_ >::Rank = Rank_

static

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

- tensor_ref.h