CUTLASS
CUDA Templates for Linear Algebra Subroutines and Solvers
Public Types | Public Member Functions | Static Public Attributes | List of all members
cutlass::Tensor4DCoord Struct Reference

Defines a canonical 4D coordinate used by tensor operations.

#include <tensor_coord.h>

Inheritance diagram for cutlass::Tensor4DCoord:
Inheritance graph
[legend]
Collaboration diagram for cutlass::Tensor4DCoord:
Collaboration graph
[legend]

Public Types

using Base = Coord< 4 >
 Base class. More...
 
using Index = typename Base::Index
 Index type. More...
 
using LongIndex = typename Base::LongIndex
 LongIndex type. More...
 
- Public Types inherited from cutlass::Coord< 4 >
using Index = int
 Index type used to store elements. More...
 
using LongIndex = int64_t
 Type used to represent linear offsets. More...
 

Public Member Functions

CUTLASS_HOST_DEVICE Tensor4DCoord ()
 Default ctor. More...
 
CUTLASS_HOST_DEVICE Tensor4DCoord (Coord< 4 > const &coord)
 Constructs from Coord<4> More...
 
CUTLASS_HOST_DEVICE Tensor4DCoord (Index n, Index h, Index w, Index c)
 Helper to construct from N, H, W, and C. More...
 
CUTLASS_HOST_DEVICE Index const & n () const
 Returns the batch of the coordinate. More...
 
CUTLASS_HOST_DEVICE Indexn ()
 Returns the batch of the coordinate. More...
 
CUTLASS_HOST_DEVICE Index const & h () const
 Returns the row of the coordinate. More...
 
CUTLASS_HOST_DEVICE Indexh ()
 Returns the row of the coordinate. More...
 
CUTLASS_HOST_DEVICE Index const & w () const
 Returns the column of the coordinate. More...
 
CUTLASS_HOST_DEVICE Indexw ()
 Returns the column of the coordinate. More...
 
CUTLASS_HOST_DEVICE Index const & c () const
 Returns the channel of the coordinate. More...
 
CUTLASS_HOST_DEVICE Indexc ()
 Returns the channel of the coordinate. More...
 
CUTLASS_HOST_DEVICE Tensor4DCoord operator+ (Base const &b) const
 Element-wise addition. More...
 
CUTLASS_HOST_DEVICE Tensor4DCoord operator- (Base const &b) const
 Element-wise subtraction. More...
 
CUTLASS_HOST_DEVICE Tensor4DCoord operator* (Base const &b) const
 Element-wise multiplication. More...
 
CUTLASS_HOST_DEVICE Tensor4DCoord operator/ (Base const &b) const
 Element-wise division. More...
 
CUTLASS_HOST_DEVICE Tensor4DCoordoperator+= (Base const &b)
 In-place addition. More...
 
CUTLASS_HOST_DEVICE Tensor4DCoordoperator-= (Base const &b)
 In-place subtraction. More...
 
CUTLASS_HOST_DEVICE Tensor4DCoordoperator*= (Base const &b)
 In-place multiplication. More...
 
CUTLASS_HOST_DEVICE Tensor4DCoordoperator/= (Base const &b)
 In-place division. More...
 
- Public Member Functions inherited from cutlass::Coord< 4 >
CUTLASS_HOST_DEVICE Coord (Index value=Index(0))
 Default ctor initializes uniformly. More...
 
CUTLASS_HOST_DEVICE Coord (Index const (&_idx)[kRank])
 Constructs from an array of integers. More...
 
CUTLASS_HOST_DEVICE Coord (Coord< kRank, Index, LongIndex > const &coord)
 Copy constructor. More...
 
CUTLASS_HOST_DEVICE Coord< Slice > slice (int start=0, Index identity=0) const
 
CUTLASS_HOST_DEVICE int min_dim_index () const
 Returns the index of the dimension with least value. More...
 
CUTLASS_HOST_DEVICE int max_dim_index () const
 Returns the index of the dimension with greatest value. More...
 
CUTLASS_HOST_DEVICE operator bool () const
 Returns true if Coord is non-zero. More...
 
CUTLASS_HOST_DEVICE bool operator! () const
 Returns true if Coord is uniformly zero. More...
 
CUTLASS_HOST_DEVICE Coord operator+ (Coord const &b) const
 Element-wise addition. More...
 
CUTLASS_HOST_DEVICE Coord operator- (Coord const &b) const
 Element-wise subtraction. More...
 
CUTLASS_HOST_DEVICE Coord operator* (Coord const &b) const
 Element-wise multiplication. More...
 
CUTLASS_HOST_DEVICE Coord operator/ (Coord const &b) const
 Element-wise division. More...
 
CUTLASS_HOST_DEVICE Coordoperator+= (Coord const &b)
 In-place addition. More...
 
CUTLASS_HOST_DEVICE Coordoperator-= (Coord const &b)
 In-place subtraction. More...
 
CUTLASS_HOST_DEVICE Coordoperator*= (Coord const &b)
 In-place multiplication. More...
 
CUTLASS_HOST_DEVICE Coordoperator/= (Coord const &b)
 In-place division. More...
 
CUTLASS_HOST_DEVICE Indexoperator[] (int dim)
 Member access operator. More...
 
CUTLASS_HOST_DEVICE Index const & operator[] (int dim) const
 Member access operator. More...
 
CUTLASS_HOST_DEVICE LongIndex dot (Coord const &b, LongIndex sum=LongIndex(0)) const
 Computes the dot product with anotherCoord object. More...
 
CUTLASS_HOST_DEVICE Indexat ()
 Gets the index of a given Coord element. More...
 
CUTLASS_HOST_DEVICE Indexat (int dim)
 Access via index; may limit unrolling potential. More...
 
CUTLASS_HOST_DEVICE Index const & at () const
 Gets the index of a given Coord element. More...
 
CUTLASS_HOST_DEVICE Index const & at (int dim) const
 Access via index; may limit unrolling potential. More...
 
CUTLASS_HOST_DEVICE bool operator== (Coord const &b) const
 Determines if two Coord<> objects are equal. More...
 
CUTLASS_HOST_DEVICE bool operator!= (Coord const &b) const
 Not equal. More...
 
CUTLASS_HOST_DEVICE Coordclamp (Coord const &max, Coord const &min=Coord())
 Clamps a coordinate to a range specified by maximum and minimum values. More...
 
CUTLASS_HOST_DEVICE Index sum () const
 Returns the sum of all elements. More...
 
CUTLASS_HOST_DEVICE LongIndex product () const
 Returns the product of all elements. More...
 
CUTLASS_HOST_DEVICE bool operator< (Coord const &b) const
 Less than operator. More...
 
CUTLASS_HOST_DEVICE bool operator<= (Coord const &b) const
 Less than or equals operator. More...
 
CUTLASS_HOST_DEVICE bool operator> (Coord const &b) const
 Greater than operator. More...
 
CUTLASS_HOST_DEVICE bool operator>= (Coord const &b) const
 Greater than or equals operator. More...
 

Static Public Attributes

static int const kN = 0
 Batch dimension. More...
 
static int const kH = 1
 Height dimension. More...
 
static int const kW = 2
 Width dimension. More...
 
static int const kC = 3
 Channels dimension. More...
 
- Static Public Attributes inherited from cutlass::Coord< 4 >
static int const kRank
 Number of elements in Coord. More...
 

Member Typedef Documentation

Constructor & Destructor Documentation

CUTLASS_HOST_DEVICE cutlass::Tensor4DCoord::Tensor4DCoord ( )
inline
CUTLASS_HOST_DEVICE cutlass::Tensor4DCoord::Tensor4DCoord ( Coord< 4 > const &  coord)
inline
CUTLASS_HOST_DEVICE cutlass::Tensor4DCoord::Tensor4DCoord ( Index  n,
Index  h,
Index  w,
Index  c 
)
inline

Member Function Documentation

CUTLASS_HOST_DEVICE Index const& cutlass::Tensor4DCoord::c ( ) const
inline
CUTLASS_HOST_DEVICE Index& cutlass::Tensor4DCoord::c ( )
inline
CUTLASS_HOST_DEVICE Index const& cutlass::Tensor4DCoord::h ( ) const
inline
CUTLASS_HOST_DEVICE Index& cutlass::Tensor4DCoord::h ( )
inline
CUTLASS_HOST_DEVICE Index const& cutlass::Tensor4DCoord::n ( ) const
inline
CUTLASS_HOST_DEVICE Index& cutlass::Tensor4DCoord::n ( )
inline
CUTLASS_HOST_DEVICE Tensor4DCoord cutlass::Tensor4DCoord::operator* ( Base const &  b) const
inline
CUTLASS_HOST_DEVICE Tensor4DCoord& cutlass::Tensor4DCoord::operator*= ( Base const &  b)
inline
CUTLASS_HOST_DEVICE Tensor4DCoord cutlass::Tensor4DCoord::operator+ ( Base const &  b) const
inline
CUTLASS_HOST_DEVICE Tensor4DCoord& cutlass::Tensor4DCoord::operator+= ( Base const &  b)
inline
CUTLASS_HOST_DEVICE Tensor4DCoord cutlass::Tensor4DCoord::operator- ( Base const &  b) const
inline
CUTLASS_HOST_DEVICE Tensor4DCoord& cutlass::Tensor4DCoord::operator-= ( Base const &  b)
inline
CUTLASS_HOST_DEVICE Tensor4DCoord cutlass::Tensor4DCoord::operator/ ( Base const &  b) const
inline
CUTLASS_HOST_DEVICE Tensor4DCoord& cutlass::Tensor4DCoord::operator/= ( Base const &  b)
inline
CUTLASS_HOST_DEVICE Index const& cutlass::Tensor4DCoord::w ( ) const
inline
CUTLASS_HOST_DEVICE Index& cutlass::Tensor4DCoord::w ( )
inline

Member Data Documentation

int const cutlass::Tensor4DCoord::kC = 3
static
int const cutlass::Tensor4DCoord::kH = 1
static
int const cutlass::Tensor4DCoord::kN = 0
static
int const cutlass::Tensor4DCoord::kW = 2
static

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