CUTLASS
CUDA Templates for Linear Algebra Subroutines and Solvers
|
#include <tensor_view.h>
Public Types | |
using | Base = cutlass::TensorRef< Element_, Layout_ > |
Base tensor reference. More... | |
using | Layout = Layout_ |
Mapping function from logical coordinate to internal n-D array. More... | |
using | ConstTensorRef = typename Base::ConstTensorRef |
TensorRef pointing to constant memory. More... | |
using | TensorRef = Base |
Underlying TensorRef type. More... | |
using | Element = Element_ |
Data type of individual access. More... | |
using | Reference = Element & |
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 |
Coordinate in storage n-D array. More... | |
using | ConstTensorView = TensorView< typename platform::remove_const< Element >::type const, Layout > |
TensorView pointing to constant memory. More... | |
using | NonConstTensorView = TensorView< typename platform::remove_const< Element >::type, Layout > |
TensorView pointing to non-constant memory. More... | |
Public Types inherited from cutlass::TensorRef< Element_, Layout_ > | |
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 | TensorView (TensorCoord const &extent=TensorCoord()) |
Constructs a TensorView object. More... | |
CUTLASS_HOST_DEVICE | TensorView (Element *ptr, Layout const &layout, TensorCoord const &extent) |
Constructs a TensorView object. More... | |
CUTLASS_HOST_DEVICE | TensorView (TensorRef const &ref, TensorCoord const &extent) |
Constructs a TensorView object. More... | |
CUTLASS_HOST_DEVICE | TensorView (NonConstTensorView const &view) |
Converting constructor from TensorRef to non-constant data. More... | |
CUTLASS_HOST_DEVICE void | reset (Element *ptr, Layout const &layout, TensorCoord size) |
Updates the pointer and layout object. More... | |
CUTLASS_HOST_DEVICE void | resize (TensorCoord extent) |
Changes the size of the view without affecting pointer or layout. More... | |
CUTLASS_HOST_DEVICE TensorCoord const & | extent () const |
Returns the extent of the view (the size along each logical dimension). More... | |
CUTLASS_HOST_DEVICE Index | extent (int dim) const |
Returns the extent along a particular logical dimension. More... | |
CUTLASS_HOST_DEVICE bool | contains (TensorCoord const &coord) const |
Determines whether a location is within a tensor. More... | |
CUTLASS_HOST_DEVICE TensorRef | ref () const |
Returns a TensorRef pointing to the first element of the tensor. More... | |
CUTLASS_HOST_DEVICE ConstTensorRef | const_ref () const |
Returns a TensorRef pointing to the first element of the tensor. More... | |
CUTLASS_HOST_DEVICE ConstTensorView | const_view () const |
Returns a TensorView to const data. More... | |
CUTLASS_HOST_DEVICE TensorView | subview (TensorCoord extent, TensorCoord const &location=TensorCoord()) const |
Returns a Tensor_view given location and size quantities. More... | |
CUTLASS_HOST_DEVICE size_t | capacity () const |
Returns the number of scalar elements needed to store tensor. More... | |
CUTLASS_HOST_DEVICE TensorView | operator+ (TensorCoord const &b) const |
Returns a TensorView offset by a given amount. More... | |
CUTLASS_HOST_DEVICE TensorView & | operator+= (TensorCoord const &b) |
Returns a TensorRef offset by a given amount. More... | |
CUTLASS_HOST_DEVICE TensorView | operator- (TensorCoord const &b) const |
Returns a TensorRef offset by a given amount. More... | |
CUTLASS_HOST_DEVICE TensorView & | operator-= (TensorCoord const &b) |
Returns a TensorRef offset by a given amount. More... | |
Public Member Functions inherited from cutlass::TensorRef< Element_, Layout_ > | |
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... | |
Static Public Attributes inherited from cutlass::TensorRef< Element_, Layout_ > | |
static int const | kRank = Layout::kRank |
Logical rank of tensor index space. More... | |
using cutlass::TensorView< Element_, Layout_ >::Base = cutlass::TensorRef<Element_, Layout_> |
using cutlass::TensorView< Element_, Layout_ >::ConstTensorRef = typename Base::ConstTensorRef |
using cutlass::TensorView< Element_, Layout_ >::ConstTensorView = TensorView< typename platform::remove_const<Element>::type const, Layout> |
using cutlass::TensorView< Element_, Layout_ >::Element = Element_ |
using cutlass::TensorView< Element_, Layout_ >::Index = typename Layout::Index |
using cutlass::TensorView< Element_, Layout_ >::Layout = Layout_ |
using cutlass::TensorView< Element_, Layout_ >::LongIndex = typename Layout::LongIndex |
using cutlass::TensorView< Element_, Layout_ >::NonConstTensorView = TensorView< typename platform::remove_const<Element>::type, Layout> |
using cutlass::TensorView< Element_, Layout_ >::Reference = Element & |
using cutlass::TensorView< Element_, Layout_ >::Stride = typename Layout::Stride |
using cutlass::TensorView< Element_, Layout_ >::TensorCoord = typename Layout::TensorCoord |
using cutlass::TensorView< Element_, Layout_ >::TensorRef = Base |
|
inline |
|
inline |
ptr | pointer to start of tensor |
layout | layout object containing stride and mapping function |
extent | size of the view in logical coordinates |
|
inline |
ref | pointer and layout object referencing a tensor |
extent | logical size of tensor |
|
inline |
view | TensorView to non-const data |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
b | offset in the logical coordinate space of the tensor |
|
inline |
b | offset in the logical coordinate space of the tensor |
|
inline |
b | offset in the logical coordinate space of the tensor |
|
inline |
b | offset in the logical coordinate space of the tensor |
|
inline |
|
inline |
|
inline |
|
inline |
extent | extent of the resulting view |
location | resulting view's origin within the old view |
|
static |