39 #include "Memleak_check.hpp"
65 virtual bool flush() {
return true;};
73 virtual size_t size()
const;
75 virtual bool resize(
size_t sz);
97 virtual long int ref()
127 std::cerr <<
"Error: " << __FILE__ <<
" " << __LINE__ <<
" destroying a live object" <<
"\n";
long int ref_cnt
Reference counter.
virtual void * getDevicePointer()
get a readable pointer with the data
bool isInitialized()
Allocated Memory is already initialized.
virtual bool resize(size_t sz)
resize the memory allocated
bool copyDeviceToDevice(const PtrMemory &m)
copy from same Heap to Heap
virtual bool flush()
flush the memory
void setAlignment(size_t align)
Set alignment the memory will be aligned with this number.
virtual void deviceToHost()
Do nothing.
bool copyFromPointer(const void *ptr, size_t sz)
copy from Pointer to Heap
virtual void destroy()
destroy memory
virtual void decRef()
Decrement the reference counter.
virtual long int ref()
Return the reference counter.
PtrMemory(void *ptr, size_t sz)
Constructor, we choose a default alignment of 32 for avx.
virtual void incRef()
Increment the reference counter.
virtual size_t size() const
the the size of the allocated memory
virtual void * getPointer()
get a readable pointer with the data
virtual bool allocate(size_t sz)
allocate memory
size_t spm
Size of the pointed memory.
virtual bool copy(const memory &m)
copy memory
This class give memory from a preallocated memory, memory destruction is not performed.