OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
memory Class Referenceabstract

Detailed Description

Definition at line 22 of file memory.hpp.

+ Inheritance diagram for memory:

Public Member Functions

virtual bool flush ()=0
 Flush the memory into the device.
 
virtual bool allocate (size_t sz)=0
 allocate on device a buffer of
 
virtual bool resize (size_t sz)=0
 resize on device a buffer
 
virtual void destroy ()=0
 Destroy the buffer on the device.
 
virtual bool copy (const memory &m)=0
 Copy the memory from one device to another device.
 
virtual size_t size () const =0
 get the size of the buffer
 
virtual void * getPointer ()=0
 return a data pointer
 
virtual const void * getPointer () const =0
 return a data pointer
 
virtual ~memory ()
 destructor
 
virtual void incRef ()=0
 Increment the internal reference counter.
 
virtual void decRef ()=0
 Decrement the internal reference counter.
 
virtual long int ref ()=0
 Return the actual reference counter.
 
virtual bool isInitialized ()=0
 Return if the actual memory that is going to be allocated is already initialized.
 
virtual void * getDevicePointer ()=0
 Return the device pointer of the memory.
 
virtual void deviceToHost ()=0
 Copy the memory from device to host.
 
virtual void hostToDevice ()=0
 Copy the memory from host to device.
 
virtual void hostToDevice (size_t start, size_t top)=0
 Copy the memory from host to device.
 
virtual void deviceToHost (size_t start, size_t stop)=0
 Copy the memory from device to host.
 
virtual void fill (unsigned char c)=0
 Fill the buffer with a particular byte.
 

Constructor & Destructor Documentation

◆ ~memory()

virtual memory::~memory ( )
inlinevirtual

destructor

destructor

Definition at line 93 of file memory.hpp.

Member Function Documentation

◆ allocate()

virtual bool memory::allocate ( size_t  sz)
pure virtual

allocate on device a buffer of

Allocate on the device a buffer of memory

Parameters
szthe size of the buffer

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ copy()

virtual bool memory::copy ( const memory m)
pure virtual

Copy the memory from one device to another device.

Parameters
mfrom where to copy

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ decRef()

virtual void memory::decRef ( )
pure virtual

Decrement the internal reference counter.

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ destroy()

virtual void memory::destroy ( )
pure virtual

Destroy the buffer on the device.

destroy the buffer on the device

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ deviceToHost() [1/2]

virtual void memory::deviceToHost ( )
pure virtual

Copy the memory from device to host.

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ deviceToHost() [2/2]

virtual void memory::deviceToHost ( size_t  start,
size_t  stop 
)
pure virtual

Copy the memory from device to host.

Parameters
startfrom start
stopto stop

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ fill()

virtual void memory::fill ( unsigned char  c)
pure virtual

Fill the buffer with a particular byte.

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ flush()

virtual bool memory::flush ( )
pure virtual

Flush the memory into the device.

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ getDevicePointer()

virtual void * memory::getDevicePointer ( )
pure virtual

Return the device pointer of the memory.

Returns
the device pointer

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ getPointer() [1/2]

virtual const void * memory::getPointer ( ) const
pure virtual

return a data pointer

return readable pointer with the data stored

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ getPointer() [2/2]

virtual void * memory::getPointer ( )
pure virtual

return a data pointer

return readable pointer with the data stored

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ hostToDevice() [1/2]

virtual void memory::hostToDevice ( )
pure virtual

Copy the memory from host to device.

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ hostToDevice() [2/2]

virtual void memory::hostToDevice ( size_t  start,
size_t  top 
)
pure virtual

Copy the memory from host to device.

Parameters
start
stop

Implemented in ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, CudaMemory, and PtrMemory.

◆ incRef()

virtual void memory::incRef ( )
pure virtual

Increment the internal reference counter.

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ isInitialized()

virtual bool memory::isInitialized ( )
pure virtual

Return if the actual memory that is going to be allocated is already initialized.

Returns
true if already initialized

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ ref()

virtual long int memory::ref ( )
pure virtual

Return the actual reference counter.

Returns
the reference counter

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ resize()

virtual bool memory::resize ( size_t  sz)
pure virtual

resize on device a buffer

On the device resize

Parameters
szthe size the resized buffer

Implemented in CudaMemory, ExtPreAlloc< Mem >, ExtPreAlloc< CudaMemory >, ExtPreAlloc< HeapMemory >, HeapMemory, and PtrMemory.

◆ size()

virtual size_t memory::size ( ) const
pure virtual

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