mxnet
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mxnet::common::StaticArray< T, num > Struct Template Reference

Static array. This code is borrowed from struct Shape<ndim>, except that users can specify the type of the elements of the statically allocated array. The object instance of the struct is copyable between CPU and GPU. More...

#include <static_array.h>

Collaboration diagram for mxnet::common::StaticArray< T, num >:
Collaboration graph

Public Member Functions

MSHADOW_XINLINE StaticArray (void)
 default constructor, do nothing More...
 
MSHADOW_XINLINE StaticArray (const T &val)
 constructor, fill in the array with the input value More...
 
MSHADOW_XINLINE StaticArray (const StaticArray< T, num > &sa)
 constuctor More...
 
MSHADOW_XINLINE T & operator[] (const index_t idx)
 
MSHADOW_XINLINE const T & operator[] (const index_t idx) const
 

Public Attributes

array_ [kNum]
 

Static Public Attributes

static const int kNum = num
 

Detailed Description

template<typename T, int num>
struct mxnet::common::StaticArray< T, num >

Static array. This code is borrowed from struct Shape<ndim>, except that users can specify the type of the elements of the statically allocated array. The object instance of the struct is copyable between CPU and GPU.

Template Parameters
Telement type of the array, must be copyable between CPU and GPU
numnumber of elements in the array

Constructor & Destructor Documentation

◆ StaticArray() [1/3]

template<typename T, int num>
MSHADOW_XINLINE mxnet::common::StaticArray< T, num >::StaticArray ( void  )
inline

default constructor, do nothing

◆ StaticArray() [2/3]

template<typename T, int num>
MSHADOW_XINLINE mxnet::common::StaticArray< T, num >::StaticArray ( const T &  val)
inline

constructor, fill in the array with the input value

◆ StaticArray() [3/3]

template<typename T, int num>
MSHADOW_XINLINE mxnet::common::StaticArray< T, num >::StaticArray ( const StaticArray< T, num > &  sa)
inline

constuctor

Member Function Documentation

◆ operator[]() [1/2]

template<typename T, int num>
MSHADOW_XINLINE T& mxnet::common::StaticArray< T, num >::operator[] ( const index_t  idx)
inline

◆ operator[]() [2/2]

template<typename T, int num>
MSHADOW_XINLINE const T& mxnet::common::StaticArray< T, num >::operator[] ( const index_t  idx) const
inline

Member Data Documentation

◆ array_

template<typename T, int num>
T mxnet::common::StaticArray< T, num >::array_[kNum]

◆ kNum

template<typename T, int num>
const int mxnet::common::StaticArray< T, num >::kNum = num
static

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