CUV  0.9.201304091348
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Public Attributes | List of all members
cuv::cuda_array< __value_type, __memory_space_type, __index_type > Class Template Reference

Wrapper for a 2D CUDAArray. More...

#include <cuda_array.hpp>

Inheritance diagram for cuv::cuda_array< __value_type, __memory_space_type, __index_type >:
Inheritance graph
[legend]
Collaboration diagram for cuv::cuda_array< __value_type, __memory_space_type, __index_type >:
Collaboration graph
[legend]

Public Types

typedef __memory_space_type memory_space_type
 Indicates whether matrix resides on host or device.
typedef matrix< __value_type,
__index_type > 
base_type
 Basic matrix type.
typedef base_type::value_type value_type
 Type of matrix entries.
typedef base_type::index_type index_type
 Type of indices.
typedef cuda_array< value_type,
memory_space_type, index_type
my_type
 Type of this object.
- Public Types inherited from cuv::matrix< __value_type, __index_type >
typedef __value_type value_type
 Type of the entries of matrix.
typedef __index_type index_type
 Type of indices.

Public Member Functions

 cuda_array (const index_type &height, const index_type &width, const index_type &depth=1, const unsigned int dim=1)
 Construct uninitialized memory with given width/height.
template<class S >
 cuda_array (const tensor< value_type, S, row_major > &src, const unsigned int dim=1)
 Construct by copying.
 ~cuda_array ()
index_type w () const
 width
index_type h () const
 height
index_type d () const
 depth
index_type n () const
 number of elements
index_type dim () const
 size of a single array element (in units of sizeof(value_type))
cudaArray * ptr ()
 the wrapped cudaArray
const cudaArray * ptr () const
 the wrapped cudaArray
void alloc ()
 allocate memory
void dealloc ()
 free memory
void assign (const tensor< __value_type, dev_memory_space, row_major > &src)
 assign memory
void assign (const tensor< __value_type, host_memory_space, row_major > &src)
 assign memory
__value_type operator() (const __index_type &i, const __index_type &j) const
 broken/useless.
- Public Member Functions inherited from cuv::matrix< __value_type, __index_type >
 matrix (const index_type &h, const index_type &w)
 Basic constructor: set width and height of matrix but do not allocate any memory.
 matrix (const matrix< value_type, index_type > &m)
 Copy Constructor.
matrix< value_type, index_type > & operator= (const matrix< value_type, index_type > &m)
 assignment operator
virtual ~matrix ()
void resize (const index_type &h, const index_type &w)
 Resizing matrix: changing width and height without changing memory layout.

Public Attributes

index_type m_depth
 < height of the array

Additional Inherited Members

- Protected Attributes inherited from cuv::matrix< __value_type, __index_type >
index_type m_width
 Width of matrix.
index_type m_height
 Heigth of matrix.

Detailed Description

template<class __value_type, class __memory_space_type, class __index_type = unsigned int>
class cuv::cuda_array< __value_type, __memory_space_type, __index_type >

Wrapper for a 2D CUDAArray.

Definition at line 53 of file cuda_array.hpp.

Constructor & Destructor Documentation

template<class __value_type, class __memory_space_type, class __index_type = unsigned int>
cuv::cuda_array< __value_type, __memory_space_type, __index_type >::cuda_array ( const index_type height,
const index_type width,
const index_type depth = 1,
const unsigned int  dim = 1 
)
inline

Construct uninitialized memory with given width/height.

Parameters
dimdimension of a single point in the array (can be 1 or 4)

when type is float and dim=1 then the cudaArray is float

when type is float and dim=4 then the cudaArray is float4

Definition at line 78 of file cuda_array.hpp.

template<class __value_type, class __memory_space_type, class __index_type = unsigned int>
template<class S >
cuv::cuda_array< __value_type, __memory_space_type, __index_type >::cuda_array ( const tensor< value_type, S, row_major > &  src,
const unsigned int  dim = 1 
)
inline

Construct by copying.

Parameters
dimdimension of a single point in the array (can be 1 or 4)

when type is float and dim=1 then the cudaArray is float

when type is float and dim=4 then the cudaArray is float4

Parameters
dimconstruct by copying a dense matrix

Definition at line 96 of file cuda_array.hpp.

template<class __value_type, class __memory_space_type, class __index_type = unsigned int>
cuv::cuda_array< __value_type, __memory_space_type, __index_type >::~cuda_array ( )
inline

< when destroying, delete associated memory

Definition at line 113 of file cuda_array.hpp.

Member Function Documentation

template<class __value_type, class __memory_space_type, class __index_type = unsigned int>
void cuv::cuda_array< __value_type, __memory_space_type, __index_type >::assign ( const tensor< __value_type, dev_memory_space, row_major > &  src)

assign memory

src.w() should be the same as this->w()*this->dim

src.h() should be the same as this->h()

template<class __value_type, class __memory_space_type, class __index_type = unsigned int>
void cuv::cuda_array< __value_type, __memory_space_type, __index_type >::assign ( const tensor< __value_type, host_memory_space, row_major > &  src)

assign memory

src.w() should be the same as this->w()*this->dim

src.h() should be the same as this->h()

Member Data Documentation

template<class __value_type, class __memory_space_type, class __index_type = unsigned int>
index_type cuv::cuda_array< __value_type, __memory_space_type, __index_type >::m_depth

< height of the array

depth of the array

Definition at line 63 of file cuda_array.hpp.


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