OpenFPM  5.2.0
Project that contain the implementation of distributed structures
memory Class Referenceabstract
+ 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 More...
 
virtual bool resize (size_t sz)=0
 resize on device a buffer More...
 
virtual void destroy ()=0
 Destroy the buffer on the device. More...
 
virtual bool copy (const memory &m)=0
 Copy the memory from one device to another device. More...
 
virtual size_t size () const =0
 get the size of the buffer
 
virtual void * getPointer ()=0
 return a data pointer More...
 
virtual const void * getPointer () const =0
 return a data pointer More...
 
virtual ~memory ()
 destructor More...
 
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. More...
 
virtual bool isInitialized ()=0
 Return if the actual memory that is going to be allocated is already initialized. More...
 
virtual void * getDevicePointer ()=0
 Return the device pointer of the memory. More...
 
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. More...
 
virtual void deviceToHost (size_t start, size_t stop)=0
 Copy the memory from device to host. More...
 
virtual void fill (unsigned char c)=0
 Fill the buffer with a particular byte.
 

Detailed Description

Definition at line 22 of file memory.hpp.

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 PtrMemory, HeapMemory, ExtPreAlloc< Mem >, ExtPreAlloc< HeapMemory >, ExtPreAlloc< CudaMemory >, and CudaMemory.

◆ 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 PtrMemory, HeapMemory, ExtPreAlloc< Mem >, ExtPreAlloc< HeapMemory >, ExtPreAlloc< CudaMemory >, and CudaMemory.

◆ destroy()

virtual void memory::destroy ( )
pure virtual

Destroy the buffer on the device.

destroy the buffer on the device

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

◆ deviceToHost()

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 PtrMemory, HeapMemory, ExtPreAlloc< Mem >, ExtPreAlloc< HeapMemory >, ExtPreAlloc< CudaMemory >, and CudaMemory.

◆ getDevicePointer()

virtual void* memory::getDevicePointer ( )
pure virtual

Return the device pointer of the memory.

Returns
the device pointer

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

◆ getPointer() [1/2]

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

return a data pointer

return readable pointer with the data stored

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

◆ getPointer() [2/2]

virtual void* memory::getPointer ( )
pure virtual

return a data pointer

return readable pointer with the data stored

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

◆ hostToDevice()

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

Copy the memory from host to device.

Parameters
start
stop

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

◆ 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 PtrMemory, HeapMemory, ExtPreAlloc< Mem >, ExtPreAlloc< HeapMemory >, ExtPreAlloc< CudaMemory >, and CudaMemory.

◆ ref()

virtual long int memory::ref ( )
pure virtual

Return the actual reference counter.

Returns
the reference counter

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

◆ 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 PtrMemory, HeapMemory, ExtPreAlloc< Mem >, ExtPreAlloc< HeapMemory >, ExtPreAlloc< CudaMemory >, and CudaMemory.


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