#include <CudappMemoryBase.h>
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 () | |
| MemoryBase & | operator= (const MemoryBase &) |
Protected Attributes | |
| MemoryLocation | Location |
| size_t | Size |
| The size of the Allocated Memory. | |
Friends | |
| class | Memory |
| Cudapp::MemoryBase::~MemoryBase | ( | ) | [virtual] |
| Cudapp::MemoryBase::MemoryBase | ( | ) | [protected] |
References Location, and MemoryOnHost.
| Cudapp::MemoryBase::MemoryBase | ( | const MemoryBase & | ) | [protected] |
| virtual bool Cudapp::MemoryBase::CopyFrom | ( | const void * | src, | |
| size_t | byte_count, | |||
| size_t | offset = 0, |
|||
| MemoryLocation | src_loc = MemoryOnHost | |||
| ) | [pure virtual] |
Implemented in Cudapp::DeviceMemory, Cudapp::LocalMemory, Cudapp::Memory, and Cudapp::MemoryArray.
| 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] |
Implemented in Cudapp::DeviceMemory, Cudapp::LocalMemory, Cudapp::Memory, and Cudapp::MemoryArray.
| 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] |
Referenced by Cudapp::Memory::CopyFromInternal().
| size_t Cudapp::MemoryBase::GetSize | ( | ) | const [inline] |
| virtual void Cudapp::MemoryBase::MemSet | ( | int | value | ) | [pure virtual] |
Implemented in Cudapp::DeviceMemory, Cudapp::LocalMemory, Cudapp::MemoryArray, and Cudapp::MemoryPitch.
| MemoryBase& Cudapp::MemoryBase::operator= | ( | const MemoryBase & | ) | [protected] |
Reimplemented in Cudapp::HostMemory, Cudapp::LocalMemory, Cudapp::Memory, Cudapp::MemoryArray, and Cudapp::MemoryPitch.
| void Cudapp::MemoryBase::PrintSelf | ( | std::ostream & | os | ) | const [virtual] |
Reimplemented in Cudapp::DeviceMemory, Cudapp::HostMemory, Cudapp::LocalMemory, Cudapp::Memory, Cudapp::MemoryArray, and Cudapp::MemoryPitch.
References GetSize().
Referenced by Cudapp::operator<<().
friend class Memory [friend] |
MemoryLocation Cudapp::MemoryBase::Location [protected] |
size_t Cudapp::MemoryBase::Size [protected] |
The size of the Allocated Memory.
Referenced by Cudapp::MemoryArray::Allocate(), Cudapp::LocalMemory::AllocateBytes(), Cudapp::HostMemory::AllocateBytes(), Cudapp::DeviceMemory::AllocateBytes(), Cudapp::MemoryPitch::Free(), Cudapp::MemoryArray::Free(), Cudapp::LocalMemory::Free(), Cudapp::HostMemory::Free(), Cudapp::DeviceMemory::Free(), Cudapp::Memory::Memory(), Cudapp::LocalMemory::MemSet(), and Cudapp::DeviceMemory::MemSet().
1.6.1