Cudapp::MemoryBase Class Reference

#include <CudappMemoryBase.h>

Inheritance diagram for Cudapp::MemoryBase:
Cudapp::Memory Cudapp::MemoryArray Cudapp::MemoryPitch Cudapp::DeviceMemory Cudapp::LocalMemory Cudapp::HostMemory

List of all members.

Public Types

enum  MemoryLocation { MemoryOnDevice, MemoryOnHost }
 

The Location of the memory is either on the Device or in Main Memory (paged or unpaged).

More...

Public Member Functions

virtual bool CopyFrom (const void *src, size_t byte_count, size_t offset=0, MemoryLocation src_loc=MemoryOnHost)=0
virtual bool CopyTo (MemoryBase *dst) const
 This function does a cast of this to the specified type and then a cast of the other to the specified type, so we are sure from what memory to what we are copying.
virtual bool CopyTo (void *dst, size_t byte_count, size_t offset=0, MemoryLocation dst_loc=MemoryOnHost) const =0
virtual void Free ()=0
 frees the memory (this must be called in each of the derived destructors)
MemoryLocation GetMemoryLocation () const
size_t GetSize () const
virtual void MemSet (int value)=0
virtual void PrintSelf (std::ostream &os) const
virtual ~MemoryBase ()

Protected Member Functions

virtual bool CopyFromInternal (const MemoryArray *src)
 HACK -> Temporary.
virtual bool CopyFromInternal (const MemoryPitch *src)
 HACK -> Temporary.
virtual bool CopyFromInternal (const Memory *src)
 MemoryBase (const MemoryBase &)
 MemoryBase ()
MemoryBaseoperator= (const MemoryBase &)

Protected Attributes

MemoryLocation Location
size_t Size
 The size of the Allocated Memory.

Friends

class Memory

Member Enumeration Documentation

The Location of the memory is either on the Device or in Main Memory (paged or unpaged).

Enumerator:
MemoryOnDevice 

The memory is located on the Device.

MemoryOnHost 

The memory is located on the Host side.


Constructor & Destructor Documentation

Cudapp::MemoryBase::~MemoryBase (  )  [virtual]
Cudapp::MemoryBase::MemoryBase (  )  [protected]

References Location, and MemoryOnHost.

Cudapp::MemoryBase::MemoryBase ( const MemoryBase  )  [protected]

Member Function Documentation

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

HACK -> Temporary.

virtual bool Cudapp::MemoryBase::CopyFromInternal ( const MemoryPitch src  )  [inline, protected, virtual]

HACK -> Temporary.

virtual bool Cudapp::MemoryBase::CopyFromInternal ( const Memory src  )  [inline, protected, virtual]

Referenced by Cudapp::Memory::CopyTo().

virtual bool Cudapp::MemoryBase::CopyTo ( MemoryBase dst  )  const [inline, virtual]

This function does a cast of this to the specified type and then a cast of the other to the specified type, so we are sure from what memory to what we are copying.

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

frees the memory (this must be called in each of the derived destructors)

Implemented in Cudapp::DeviceMemory, Cudapp::HostMemory, Cudapp::LocalMemory, Cudapp::MemoryArray, and Cudapp::MemoryPitch.

Referenced by Cudapp::Memory::CopyFromInternal().

MemoryLocation Cudapp::MemoryBase::GetMemoryLocation (  )  const [inline]
size_t Cudapp::MemoryBase::GetSize (  )  const [inline]
virtual void Cudapp::MemoryBase::MemSet ( int  value  )  [pure virtual]
MemoryBase& Cudapp::MemoryBase::operator= ( const MemoryBase  )  [protected]
void Cudapp::MemoryBase::PrintSelf ( std::ostream &  os  )  const [virtual]

Friends And Related Function Documentation

friend class Memory [friend]

Member Data Documentation

size_t Cudapp::MemoryBase::Size [protected]

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

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1