11 KF_EXPORTS void error(
const char *error_string,
const char *
file,
const int line,
const char *func =
"");
50 void create(
size_t sizeBytes_arg);
64 void upload(
const void *host_ptr_arg,
size_t sizeBytes_arg);
69 void download(
void *host_ptr_arg)
const;
77 template<
class T> T* ptr();
80 template<
class T>
const T* ptr()
const;
83 template <
class U>
operator PtrSz<U>()
const;
88 size_t sizeBytes()
const;
131 DeviceMemory2D(
int rows_arg,
int colsBytes_arg,
void *data_arg,
size_t step_arg);
143 void create(
int rows_arg,
int colsBytes_arg);
159 void upload(
const void *host_ptr_arg,
size_t host_step_arg,
int rows_arg,
int colsBytes_arg);
165 void download(
void *host_ptr_arg,
size_t host_step_arg)
const;
175 template<
class T> T* ptr(
int y_arg = 0);
180 template<
class T>
const T* ptr(
int y_arg = 0)
const;
183 template <
class U>
operator PtrStep<U>()
const;
192 int colsBytes()
const;
232 result.
data = (U*)ptr<U>();
233 result.
size = sizeBytes_/
sizeof(U);
245 result.
data = (U*)ptr<U>();
253 result.
data = (U*)ptr<U>();
255 result.
cols = colsBytes_/
sizeof(U);
size_t step
stride between two consecutive rows in bytes. Step is stored always and everywhere in bytes!!! ...
int * refcount_
Pointer to reference counter in CPU memory.
T * ptr()
Returns pointer for internal buffer in GPU memory.
int * refcount_
Pointer to reference counter in CPU memory.
size_t step_
Stride between two consecutive rows in bytes for internal buffer. Step is stored always and everywher...
size_t sizeBytes_
Allocated size in bytes.
__kf_hdevice__ void swap(T &a, T &b)
void * data_
Device pointer.
int colsBytes_
Width of the buffer in bytes.
KF_EXPORTS void error(const char *error_string, const char *file, const int line, const char *func="")
Error handler. All GPU functions from this subsystem call the function to report an error...
T * ptr(int y_arg=0)
Returns pointer to given row in internal buffer.
void * data_
Device pointer.