11#include "PtrMemory.hpp"
38 std::cerr <<
"Error: " << __FILE__ <<
" " << __LINE__ <<
" allocation failed";
78 std::cerr <<
"Error " << __LINE__ <<
" " << __FILE__ <<
": source buffer is too big to copy";
146 std::cerr <<
"Error: " << __FILE__ <<
" " << __LINE__ <<
" allocation failed";
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
virtual bool allocate(size_t sz)
allocate memory
size_t spm
Size of the pointed memory.
virtual size_t size() const
the the size of the allocated memory
bool copyDeviceToDevice(const PtrMemory &m)
copy from same Heap to Heap
virtual void * getPointer()
get a readable pointer with the data
virtual bool copy(const memory &m)
copy memory
bool copyFromPointer(const void *ptr, size_t sz)
copy from Pointer to Heap
virtual bool resize(size_t sz)
resize the memory allocated
virtual void * getPointer()=0
return a data pointer
virtual size_t size() const =0
get the size of the buffer