sofa::gpu::cuda::CudaMatrix< T > Class Template Reference

#include <CudaTypes.h>

Collaboration diagram for sofa::gpu::cuda::CudaMatrix< T >:

Collaboration graph
[legend]

Public Types

typedef T value_type
typedef size_t size_type

Public Member Functions

 CudaMatrix ()
 CudaMatrix (size_t x, size_t y)
 CudaMatrix (const CudaMatrix< T > &v)
void clear ()
 ~CudaMatrix ()
size_type getSizeX () const
size_type getSizeY () const
size_type getPitch () const
bool empty () const
void fastResize (size_type x, size_type y, size_type WARP_SIZE=BSIZE)
void resize (size_type x, size_type y, size_t WARP_SIZE=BSIZE)
void swap (CudaMatrix< T > &v)
const void * deviceRead (int x=0, int y=0) const
void * deviceWrite (int x=0, int y=0)
const T * hostRead (int x=0, int y=0) const
T * hostWrite (int x=0, int y=0)
bool isHostValid () const
bool isDeviceValid () const
const T & operator() (size_type x, size_type y) const
T & operator() (size_type x, size_type y)
const T * operator[] (size_type y) const
T * operator[] (size_type y)
const T & getCached (size_type x, size_type y) const

Protected Member Functions

void copyToHost () const
void copyToDevice () const
void checkIndex (size_type x, size_type y) const

Protected Attributes

size_type sizeX
 Current size of the vector.
size_type sizeY
 Current size of the vector.
size_type pitch
 Row alignment on the GPU.
size_type hostAllocSize
 Allocated size.
size_type deviceAllocSize
 Allocated size.
void * devicePointer
 Pointer to the data on the GPU side.
T * hostPointer
 Pointer to the data on the CPU side.
bool deviceIsValid
 True if the data on the GPU is currently valid.
bool hostIsValid
 True if the data on the CPU is currently valid.

Detailed Description

template<class T>
class sofa::gpu::cuda::CudaMatrix< T >

Definition at line 452 of file CudaTypes.h.


Member Typedef Documentation

template<class T >
typedef size_t sofa::gpu::cuda::CudaMatrix< T >::size_type

Definition at line 456 of file CudaTypes.h.

template<class T >
typedef T sofa::gpu::cuda::CudaMatrix< T >::value_type

Definition at line 455 of file CudaTypes.h.


Constructor & Destructor Documentation

template<class T >
sofa::gpu::cuda::CudaMatrix< T >::CudaMatrix (  )  [inline]

Definition at line 470 of file CudaTypes.h.

template<class T >
sofa::gpu::cuda::CudaMatrix< T >::CudaMatrix ( size_t  x,
size_t  y 
) [inline]

Definition at line 474 of file CudaTypes.h.

References sofa::gpu::cuda::CudaMatrix< T >::resize().

template<class T >
sofa::gpu::cuda::CudaMatrix< T >::CudaMatrix ( const CudaMatrix< T > &  v  )  [inline]

Definition at line 479 of file CudaTypes.h.

template<class T >
sofa::gpu::cuda::CudaMatrix< T >::~CudaMatrix (  )  [inline]


Member Function Documentation

template<class T >
void sofa::gpu::cuda::CudaMatrix< T >::checkIndex ( size_type  x,
size_type  y 
) const [inline, protected]

template<class T >
void sofa::gpu::cuda::CudaMatrix< T >::clear (  )  [inline]

template<class T >
void sofa::gpu::cuda::CudaMatrix< T >::copyToDevice (  )  const [inline, protected]

template<class T >
void sofa::gpu::cuda::CudaMatrix< T >::copyToHost (  )  const [inline, protected]

template<class T >
const void* sofa::gpu::cuda::CudaMatrix< T >::deviceRead ( int  x = 0,
int  y = 0 
) const [inline]

template<class T >
void* sofa::gpu::cuda::CudaMatrix< T >::deviceWrite ( int  x = 0,
int  y = 0 
) [inline]

template<class T >
bool sofa::gpu::cuda::CudaMatrix< T >::empty (  )  const [inline]

template<class T >
void sofa::gpu::cuda::CudaMatrix< T >::fastResize ( size_type  x,
size_type  y,
size_type  WARP_SIZE = BSIZE 
) [inline]

template<class T >
const T& sofa::gpu::cuda::CudaMatrix< T >::getCached ( size_type  x,
size_type  y 
) const [inline]

template<class T >
size_type sofa::gpu::cuda::CudaMatrix< T >::getPitch (  )  const [inline]

Definition at line 505 of file CudaTypes.h.

References sofa::gpu::cuda::CudaMatrix< T >::pitch.

template<class T >
size_type sofa::gpu::cuda::CudaMatrix< T >::getSizeX (  )  const [inline]

Definition at line 497 of file CudaTypes.h.

References sofa::gpu::cuda::CudaMatrix< T >::sizeX.

template<class T >
size_type sofa::gpu::cuda::CudaMatrix< T >::getSizeY (  )  const [inline]

Definition at line 501 of file CudaTypes.h.

References sofa::gpu::cuda::CudaMatrix< T >::sizeY.

template<class T >
const T* sofa::gpu::cuda::CudaMatrix< T >::hostRead ( int  x = 0,
int  y = 0 
) const [inline]

template<class T >
T* sofa::gpu::cuda::CudaMatrix< T >::hostWrite ( int  x = 0,
int  y = 0 
) [inline]

template<class T >
bool sofa::gpu::cuda::CudaMatrix< T >::isDeviceValid (  )  const [inline]

Definition at line 590 of file CudaTypes.h.

References sofa::gpu::cuda::CudaMatrix< T >::deviceIsValid.

template<class T >
bool sofa::gpu::cuda::CudaMatrix< T >::isHostValid (  )  const [inline]

Definition at line 586 of file CudaTypes.h.

References sofa::gpu::cuda::CudaMatrix< T >::hostIsValid.

template<class T >
T& sofa::gpu::cuda::CudaMatrix< T >::operator() ( size_type  x,
size_type  y 
) [inline]

template<class T >
const T& sofa::gpu::cuda::CudaMatrix< T >::operator() ( size_type  x,
size_type  y 
) const [inline]

template<class T >
T* sofa::gpu::cuda::CudaMatrix< T >::operator[] ( size_type  y  )  [inline]

template<class T >
const T* sofa::gpu::cuda::CudaMatrix< T >::operator[] ( size_type  y  )  const [inline]

template<class T >
void sofa::gpu::cuda::CudaMatrix< T >::resize ( size_type  x,
size_type  y,
size_t  WARP_SIZE = BSIZE 
) [inline]

template<class T >
void sofa::gpu::cuda::CudaMatrix< T >::swap ( CudaMatrix< T > &  v  )  [inline]


Field Documentation

template<class T >
size_type sofa::gpu::cuda::CudaMatrix< T >::deviceAllocSize [protected]

Allocated size.

Definition at line 463 of file CudaTypes.h.

Referenced by sofa::gpu::cuda::CudaMatrix< T >::fastResize(), and sofa::gpu::cuda::CudaMatrix< T >::swap().

template<class T >
bool sofa::gpu::cuda::CudaMatrix< T >::deviceIsValid [mutable, protected]

template<class T >
void* sofa::gpu::cuda::CudaMatrix< T >::devicePointer [protected]

template<class T >
size_type sofa::gpu::cuda::CudaMatrix< T >::hostAllocSize [protected]

Allocated size.

Definition at line 462 of file CudaTypes.h.

Referenced by sofa::gpu::cuda::CudaMatrix< T >::fastResize(), and sofa::gpu::cuda::CudaMatrix< T >::swap().

template<class T >
bool sofa::gpu::cuda::CudaMatrix< T >::hostIsValid [mutable, protected]

template<class T >
T* sofa::gpu::cuda::CudaMatrix< T >::hostPointer [protected]

template<class T >
size_type sofa::gpu::cuda::CudaMatrix< T >::pitch [protected]

template<class T >
size_type sofa::gpu::cuda::CudaMatrix< T >::sizeX [protected]

template<class T >
size_type sofa::gpu::cuda::CudaMatrix< T >::sizeY [protected]


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

Generated on Sun Nov 23 04:24:06 2008 for Sofa by  doxygen 1.5.7.1