CUTLASS
CUDA Templates for Linear Algebra Subroutines and Solvers
|
#include <tensor_ref.h>
Public Types | |
using | Element = Element_ |
Data type of individual access. More... | |
using | Layout = Layout_ |
Mapping function from logical coordinate to linear memory. More... | |
using | Reference = typename platform::conditional< sizeof_bits< Element >::value >=8, Element &, SubbyteReference< Element > >::type |
Reference type to an element. More... | |
using | Index = typename Layout::Index |
Index type. More... | |
using | LongIndex = typename Layout::LongIndex |
Long index used for pointer offsets. More... | |
using | TensorCoord = typename Layout::TensorCoord |
Coordinate in logical tensor space. More... | |
using | Stride = typename Layout::Stride |
Layout's stride vector. More... | |
using | ConstTensorRef = TensorRef< typename platform::remove_const< Element >::type const, Layout > |
TensorRef to constant data. More... | |
using | NonConstTensorRef = TensorRef< typename platform::remove_const< Element >::type, Layout > |
TensorRef to non-constant data. More... | |
Public Member Functions | |
CUTLASS_HOST_DEVICE | TensorRef (Element *ptr=nullptr, Layout const &layout=Layout()) |
Constructs a TensorRef with a pointer and layout object. More... | |
CUTLASS_HOST_DEVICE | TensorRef (NonConstTensorRef const &ref) |
Converting constructor from TensorRef to non-constant data. More... | |
CUTLASS_HOST_DEVICE ConstTensorRef | const_ref () const |
Returns a reference to constant-valued tensor. More... | |
CUTLASS_HOST_DEVICE NonConstTensorRef | non_const_ref () const |
CUTLASS_HOST_DEVICE void | reset (Element *ptr=nullptr) |
Updates only the pointer. More... | |
CUTLASS_HOST_DEVICE void | reset (Element *ptr, Layout const &layout) |
Updates the pointer and layout object. More... | |
CUTLASS_HOST_DEVICE bool | good () const |
Returns true if the TensorRef is non-null. More... | |
CUTLASS_HOST_DEVICE Element * | data () const |
Returns the pointer to referenced data. More... | |
CUTLASS_HOST_DEVICE Reference | data (LongIndex idx) const |
Returns a reference to the element at a given linear index. More... | |
CUTLASS_HOST_DEVICE Layout & | layout () |
Returns the layout object. More... | |
CUTLASS_HOST_DEVICE Layout | layout () const |
Returns the layout object. More... | |
CUTLASS_HOST_DEVICE Stride | stride () const |
Returns the layout object's stride vector. More... | |
CUTLASS_HOST_DEVICE Stride & | stride () |
Returns the layout object's stride vector. More... | |
CUTLASS_HOST_DEVICE Index | stride (int dim) const |
Returns the layout object's stride in a given physical dimension. More... | |
CUTLASS_HOST_DEVICE Index & | stride (int dim) |
Returns the layout object's stride in a given physical dimension. More... | |
CUTLASS_HOST_DEVICE LongIndex | offset (TensorCoord const &coord) const |
Computes the offset of an index from the origin of the tensor. More... | |
CUTLASS_HOST_DEVICE Reference | at (TensorCoord const &coord) const |
Returns a reference to the element at a given Coord. More... | |
CUTLASS_HOST_DEVICE Reference | operator[] (TensorCoord const &coord) const |
Returns a reference to the element at a given Coord. More... | |
CUTLASS_HOST_DEVICE TensorRef & | add_pointer_offset (LongIndex offset_) |
Adds an offset to each pointer. More... | |
CUTLASS_HOST_DEVICE TensorRef & | add_coord_offset (TensorCoord const &coord) |
Adds an offset to each pointer. More... | |
CUTLASS_HOST_DEVICE TensorRef | operator+ (TensorCoord const &b) const |
Returns a TensorRef offset by a given amount. More... | |
CUTLASS_HOST_DEVICE TensorRef & | operator+= (TensorCoord const &b) |
Returns a TensorRef offset by a given amount. More... | |
CUTLASS_HOST_DEVICE TensorRef | operator- (TensorCoord const &b) const |
Returns a TensorRef offset by a given amount. More... | |
CUTLASS_HOST_DEVICE TensorRef & | operator-= (TensorCoord const &b) |
Returns a TensorRef offset by a given amount. More... | |
Static Public Attributes | |
static int const | kRank = Layout::kRank |
Logical rank of tensor index space. More... | |
using cutlass::TensorRef< Element_, Layout_ >::ConstTensorRef = TensorRef< typename platform::remove_const<Element>::type const, Layout> |
using cutlass::TensorRef< Element_, Layout_ >::Element = Element_ |
using cutlass::TensorRef< Element_, Layout_ >::Index = typename Layout::Index |
using cutlass::TensorRef< Element_, Layout_ >::Layout = Layout_ |
using cutlass::TensorRef< Element_, Layout_ >::LongIndex = typename Layout::LongIndex |
using cutlass::TensorRef< Element_, Layout_ >::NonConstTensorRef = TensorRef< typename platform::remove_const<Element>::type, Layout> |
using cutlass::TensorRef< Element_, Layout_ >::Reference = typename platform::conditional< sizeof_bits<Element>::value >= 8, Element &, SubbyteReference<Element> >::type |
using cutlass::TensorRef< Element_, Layout_ >::Stride = typename Layout::Stride |
using cutlass::TensorRef< Element_, Layout_ >::TensorCoord = typename Layout::TensorCoord |
|
inline |
ptr | pointer to start of tensor |
layout | layout object containing stride and mapping function |
|
inline |
ref | TensorRef to non-const data |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |