62 virtual bool flush() {
return true;};
70 virtual size_t size()
const;
72 virtual bool resize(
size_t sz);
99 virtual void fill(
unsigned char c);
150 std::cerr <<
"Error: " << __FILE__ <<
" " << __LINE__ <<
" destroying a live object" <<
"\n";
This class give memory from a preallocated memory, memory destruction is not performed.
virtual void * getDevicePointer()
get a readable pointer with the data
virtual void destroy()
destroy memory
virtual void fill(unsigned char c)
fill memory with the selected byte
constexpr static bool isDeviceHostSame()
Return true if the device and the host pointer are the same.
long int ref_cnt
Reference counter.
virtual bool flush()
flush the memory
PtrMemory(void *ptr, size_t sz)
Constructor, we choose a default alignment of 32 for avx.
virtual void hostToDevice(size_t start, size_t top)
Do nothing.
virtual bool allocate(size_t sz)
allocate memory
virtual void decRef()
Decrement the reference counter.
size_t spm
Size of the pointed memory.
virtual void hostToDevice()
Do nothing.
virtual size_t size() const
the the size of the allocated memory
bool copyDeviceToDevice(const PtrMemory &m)
copy from same Heap to Heap
virtual long int ref()
Return the reference counter.
virtual void deviceToHost(size_t start, size_t stop)
Do nothing.
virtual void * getPointer()
get a readable pointer with the data
virtual bool copy(const memory &m)
copy memory
bool isInitialized()
Allocated Memory is already initialized.
virtual void incRef()
Increment the reference counter.
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 bool resize(size_t sz)
resize the memory allocated