30 #ifndef _CCL_BUFFER_WRAPPER_H_
31 #define _CCL_BUFFER_WRAPPER_H_
99 size_t size,
void *host_ptr,
CCLErr** err);
109 cl_bool blocking_read,
size_t offset,
size_t size,
void *ptr,
115 cl_bool blocking_write,
size_t offset,
size_t size,
void *ptr,
122 cl_bool blocking_map, cl_map_flags map_flags,
size_t offset,
138 const size_t *dst_origin,
const size_t *region,
145 cl_mem_flags flags,
size_t origin,
size_t size,
CCLErr** err);
151 cl_bool blocking_read,
const size_t* buffer_origin,
152 const size_t* host_origin,
const size_t* region,
153 size_t buffer_row_pitch,
size_t buffer_slice_pitch,
154 size_t host_row_pitch,
size_t host_slice_pitch,
void *ptr,
161 cl_bool blocking_write,
const size_t* buffer_origin,
162 const size_t* host_origin,
const size_t* region,
163 size_t buffer_row_pitch,
size_t buffer_slice_pitch,
164 size_t host_row_pitch,
size_t host_slice_pitch,
void *ptr,
172 const size_t *dst_origin,
const size_t *region,
173 size_t src_row_pitch,
size_t src_slice_pitch,
size_t dst_row_pitch,
180 const void *pattern,
size_t pattern_size,
size_t offset,
199 #define ccl_buffer_enqueue_unmap(buf, cq, ptr, ewl, err) \
200 ccl_memobj_enqueue_unmap((CCLMemObj*) buf, cq, ptr, ewl, err)
207 #define ccl_buffer_ref(buf) \
208 ccl_wrapper_ref((CCLWrapper*) buf)
215 #define ccl_buffer_unref(buf) ccl_buffer_destroy(buf)
223 #define ccl_buffer_unwrap(buf) \
224 ((cl_mem) ccl_wrapper_unwrap((CCLWrapper*) buf))
CCLEvent * ccl_buffer_enqueue_copy_to_image(CCLBuffer *src_buf, CCLImage *dst_img, CCLQueue *cq, size_t src_offset, const size_t *dst_origin, const size_t *region, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Copy a buffer object to an image object.
CCLEvent * ccl_buffer_enqueue_write_rect(CCLBuffer *buf, CCLQueue *cq, cl_bool blocking_write, const size_t *buffer_origin, const size_t *host_origin, const size_t *region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, void *ptr, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Write a 2D or 3D rectangular region to a buffer object from host memory.
GPtrArray * CCLEventWaitList
A list of event objects on which enqueued commands can wait.
CCLEvent * ccl_buffer_enqueue_read_rect(CCLBuffer *buf, CCLQueue *cq, cl_bool blocking_read, const size_t *buffer_origin, const size_t *host_origin, const size_t *region, size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch, void *ptr, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Read from a 2D or 3D rectangular region from a buffer object to host memory.
The context wrapper class.
Command queue wrapper class.
CCLEvent * ccl_buffer_enqueue_write(CCLBuffer *buf, CCLQueue *cq, cl_bool blocking_write, size_t offset, size_t size, void *ptr, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Write to a buffer object from host memory.
CCLBuffer * ccl_buffer_new_from_region(CCLBuffer *buf, cl_mem_flags flags, size_t origin, size_t size, CCLErr **err)
Creates a sub-buffer that represents a specific region in the given buffer.
CCLEvent * ccl_buffer_enqueue_read(CCLBuffer *buf, CCLQueue *cq, cl_bool blocking_read, size_t offset, size_t size, void *ptr, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Read from a buffer object to host memory.
CCLBuffer * ccl_buffer_new_wrap(cl_mem mem_object)
Get the buffer wrapper for the given OpenCL buffer.
CCLEvent * ccl_buffer_enqueue_fill(CCLBuffer *buf, CCLQueue *cq, const void *pattern, size_t pattern_size, size_t offset, size_t size, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Fill a buffer object with a pattern of a given pattern size.
CCLEvent * ccl_buffer_enqueue_copy_rect(CCLBuffer *src_buf, CCLBuffer *dst_buf, CCLQueue *cq, const size_t *src_origin, const size_t *dst_origin, const size_t *region, size_t src_row_pitch, size_t src_slice_pitch, size_t dst_row_pitch, size_t dst_slice_pitch, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Copy a 2D or 3D rectangular region from a buffer object to another buffer object. ...
void ccl_buffer_destroy(CCLBuffer *buf)
Decrements the reference count of the wrapper object.
Definition of a wrapper class and its methods for OpenCL memory objects.
void * ccl_buffer_enqueue_map(CCLBuffer *buf, CCLQueue *cq, cl_bool blocking_map, cl_map_flags map_flags, size_t offset, size_t size, CCLEventWaitList *evt_wait_lst, CCLEvent **evt, CCLErr **err)
Map a region of a buffer into the host address space and return a pointer to this mapped region...
CCLEvent * ccl_buffer_enqueue_copy(CCLBuffer *src_buf, CCLBuffer *dst_buf, CCLQueue *cq, size_t src_offset, size_t dst_offset, size_t size, CCLEventWaitList *evt_wait_lst, CCLErr **err)
Copy from one buffer object to another.
GError CCLErr
Error handling class.
CCLBuffer * ccl_buffer_new(CCLContext *ctx, cl_mem_flags flags, size_t size, void *host_ptr, CCLErr **err)
Create a CCLBuffer wrapper object.