31 #include "_ccl_abstract_wrapper.h"
41 #define ccl_arg_is_local(arg) \
42 (arg->info == (void*) &arg_local_marker)
49 static char arg_local_marker;
79 g_return_val_if_fail(size > 0, NULL);
83 arg->cl_object = g_memdup((
const void*) value, (guint) size);
84 arg->info = (
void*) &arg_local_marker;
85 arg->ref_count = (gint) size;
100 void ccl_arg_destroy(
CCLArg* arg) {
103 g_return_if_fail(arg != NULL);
105 if ccl_arg_is_local(arg) {
106 g_free(arg->cl_object);
107 g_slice_free(
CCLArg, arg);
121 size_t ccl_arg_size(
CCLArg* arg) {
124 g_return_val_if_fail(arg != NULL, 0);
126 return ccl_arg_is_local(arg)
127 ? (size_t) arg->ref_count
141 void* ccl_arg_value(
CCLArg* arg) {
144 g_return_val_if_fail(arg != NULL, NULL);
146 return ccl_arg_is_local(arg)
CCLArg * ccl_arg_new(void *value, size_t size)
Create a new kernel argument.
const CCLArg * ccl_arg_skip
Use this constant to skip kernel arguments in the ccl_kernel_set_args(), ccl_kernel_set_args_v(), ccl_kernel_set_args_and_enqueue_ndrange() and ccl_kernel_set_args_and_enqueue_ndrange_v() functions.
Base class for all OpenCL wrappers.
No object, enumeration termination marker.
Definition of a wrapper type and related functions for a OpenCL kernel arguments. ...