Cudapp::MemoryArray Class Reference

#include <CudappMemoryArray.h>

Inheritance diagram for Cudapp::MemoryArray:
Cudapp::MemoryBase

List of all members.

Public Member Functions

void Allocate (size_t width, size_t height)
virtual bool CopyFrom (const void *src, size_t byte_count, size_t offset=0, MemoryLocation src_loc=MemoryOnHost)
virtual bool CopyTo (void *dst, size_t byte_count, size_t offset=0, MemoryLocation dst_loc=MemoryOnHost) const
void DeepCopy (MemoryArray *source)
virtual void Free ()
 frees all the resources needed for the Array
cudaArray * GetArray () const
const cudaChannelFormatDesc & GetDescriptor () const
size_t GetHeight () const
size_t GetWidth () const
 MemoryArray (const MemoryArray &)
 MemoryArray ()
virtual void MemSet (int value)
MemoryArrayoperator= (const MemoryArray &)
virtual void PrintSelf (std::ostream &os) const
void SetChannelDescriptor (const cudaChannelFormatDesc &desc)
template<typename T >
void SetFormat ()
virtual ~MemoryArray ()

Protected Attributes

cudaArray * Array
 The Array with the memory that was allocated.
cudaChannelFormatDesc Descriptor
 The Descriptor used to allocate memory.
size_t Height
 The Height of the Array.
size_t Width
 The Width of the Array.

Constructor & Destructor Documentation

Cudapp::MemoryArray::MemoryArray (  ) 
Cudapp::MemoryArray::~MemoryArray (  )  [virtual]

References Free().

Cudapp::MemoryArray::MemoryArray ( const MemoryArray  ) 

Member Function Documentation

void Cudapp::MemoryArray::Allocate ( size_t  width,
size_t  height 
)

Allocates A new array of size width*height with the specified type T

Parameters:
width the width of the array to allocate
height the height of the array to allocate.
Note:
if there was already allocated data in this instance the data will be erased.

References Array, Descriptor, Free(), Height, Cudapp::MemoryBase::Size, and Width.

Referenced by DeepCopy().

virtual bool Cudapp::MemoryArray::CopyFrom ( const void *  src,
size_t  byte_count,
size_t  offset = 0,
MemoryLocation  src_loc = MemoryOnHost 
) [inline, virtual]

Implements Cudapp::MemoryBase.

virtual bool Cudapp::MemoryArray::CopyTo ( void *  dst,
size_t  byte_count,
size_t  offset = 0,
MemoryLocation  dst_loc = MemoryOnHost 
) const [inline, virtual]

Implements Cudapp::MemoryBase.

void Cudapp::MemoryArray::DeepCopy ( MemoryArray source  ) 

References Allocate(), Array, GetHeight(), and GetWidth().

void Cudapp::MemoryArray::Free (  )  [virtual]

frees all the resources needed for the Array

Implements Cudapp::MemoryBase.

References Array, Height, Cudapp::MemoryBase::Size, and Width.

Referenced by Allocate(), and ~MemoryArray().

cudaArray* Cudapp::MemoryArray::GetArray (  )  const [inline]
const cudaChannelFormatDesc& Cudapp::MemoryArray::GetDescriptor (  )  const [inline]
size_t Cudapp::MemoryArray::GetHeight (  )  const [inline]

Referenced by DeepCopy(), and PrintSelf().

size_t Cudapp::MemoryArray::GetWidth (  )  const [inline]

Referenced by DeepCopy(), and PrintSelf().

virtual void Cudapp::MemoryArray::MemSet ( int  value  )  [inline, virtual]

Implements Cudapp::MemoryBase.

MemoryArray& Cudapp::MemoryArray::operator= ( const MemoryArray  ) 

Reimplemented from Cudapp::MemoryBase.

void Cudapp::MemoryArray::PrintSelf ( std::ostream &  os  )  const [virtual]

Reimplemented from Cudapp::MemoryBase.

References GetHeight(), and GetWidth().

void Cudapp::MemoryArray::SetChannelDescriptor ( const cudaChannelFormatDesc &  desc  )  [inline]
template<typename T >
void Cudapp::MemoryArray::SetFormat (  )  [inline]

Member Data Documentation

cudaArray* Cudapp::MemoryArray::Array [protected]

The Array with the memory that was allocated.

Referenced by Allocate(), DeepCopy(), Free(), and MemoryArray().

cudaChannelFormatDesc Cudapp::MemoryArray::Descriptor [protected]

The Descriptor used to allocate memory.

Referenced by Allocate(), and MemoryArray().

size_t Cudapp::MemoryArray::Height [protected]

The Height of the Array.

Referenced by Allocate(), Free(), and MemoryArray().

size_t Cudapp::MemoryArray::Width [protected]

The Width of the Array.

Referenced by Allocate(), Free(), and MemoryArray().


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

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1