30 #ifndef _CCL_EVENT_WRAPPER_H_
31 #define _CCL_EVENT_WRAPPER_H_
93 cl_int event_command_exec_status,
void *user_data);
129 void *user_data,
CCLErr** err);
151 #define ccl_event_get_info(evt, param_name, err) \
152 ccl_wrapper_get_info((CCLWrapper*) evt, NULL, param_name, 0, \
153 CCL_INFO_EVENT, CL_FALSE, err)
171 #define ccl_event_get_info_scalar(evt, param_name, param_type, err) \
172 *((param_type*) ccl_wrapper_get_info_value((CCLWrapper*) evt, \
173 NULL, param_name, sizeof(param_type), CCL_INFO_EVENT, CL_FALSE, err))
191 #define ccl_event_get_info_array(evt, param_name, param_type, err) \
192 (param_type) ccl_wrapper_get_info_value((CCLWrapper*) evt, \
193 NULL, param_name, sizeof(param_type), CCL_INFO_EVENT, CL_FALSE, err)
206 #define ccl_event_get_profiling_info(evt, param_name, err) \
207 ccl_wrapper_get_info((CCLWrapper*) evt, NULL, param_name, 0, \
208 CCL_INFO_EVENT_PROFILING, CL_FALSE, err)
226 #define ccl_event_get_profiling_info_scalar(evt, param_name, param_type, err) \
227 *((param_type*) ccl_wrapper_get_info_value((CCLWrapper*) evt, \
228 NULL, param_name, sizeof(param_type), \
229 CCL_INFO_EVENT_PROFILING, CL_FALSE, err))
247 #define ccl_event_get_profiling_info_array(evt, param_name, param_type, err) \
248 (param_type) ccl_wrapper_get_info_value((CCLWrapper*) evt, \
249 NULL, param_name, sizeof(param_type), \
250 CCL_INFO_EVENT_PROFILING, CL_FALSE, err)
257 #define ccl_event_ref(evt) \
258 ccl_wrapper_ref((CCLWrapper*) evt)
266 #define ccl_event_unref(evt) ccl_event_destroy(evt)
274 #define ccl_event_unwrap(evt) \
275 ((cl_event) ccl_wrapper_unwrap((CCLWrapper*) evt))
331 #define ccl_ewl ccl_event_wait_list_add
358 #define ccl_event_wait_list_get_num_events(evt_wait_lst) \
359 ((((evt_wait_lst) != NULL) && (*(evt_wait_lst) != NULL)) \
360 ? (*(evt_wait_lst))->len \
373 #define ccl_event_wait_list_get_clevents(evt_wait_lst) \
374 ((((evt_wait_lst) != NULL) && (*(evt_wait_lst) != NULL)) \
375 ? (const cl_event*) (*(evt_wait_lst))->pdata \
void ccl_event_set_name(CCLEvent *evt, const char *name)
Set event name for profiling purposes.
const char * ccl_event_get_final_name(CCLEvent *evt)
Get the final event name for profiling purposes.
cl_bool ccl_event_set_callback(CCLEvent *evt, cl_int command_exec_callback_type, ccl_event_callback pfn_notify, void *user_data, CCLErr **err)
Wrapper for OpenCL clSetEventCallback() function.
CCLEvent * ccl_user_event_new(CCLContext *ctx, CCLErr **err)
Create a new user event.
GPtrArray * CCLEventWaitList
A list of event objects on which enqueued commands can wait.
void ccl_event_destroy(CCLEvent *evt)
Decrements the reference count of the event wrapper object.
Definition of a wrapper class and its methods for OpenCL context objects.
The context wrapper class.
void ccl_event_wait_list_clear(CCLEventWaitList *evt_wait_lst)
Clears an event wait list.
cl_uint ccl_event_get_opencl_version(CCLEvent *evt, CCLErr **err)
Get the OpenCL version of the platform associated with this event object.
CCLEventWaitList * ccl_event_wait_list_add_v(CCLEventWaitList *evt_wait_lst, CCLEvent **evt)
Add event wrapper objects to an event wait list (array version).
cl_command_type ccl_event_get_command_type(CCLEvent *evt, CCLErr **err)
Get the command type which fired the given event.
cl_bool ccl_user_event_set_status(CCLEvent *evt, cl_int execution_status, CCLErr **err)
Sets the execution status of a user event object.
const char * ccl_event_get_name(CCLEvent *evt)
Get the event name for profiling purposes.
Definition of an abstract wrapper class and its methods for OpenCL objects.
Header for normalizing OpenCL versions within cf4ocl.
CCLEventWaitList * ccl_event_wait_list_add(CCLEventWaitList *evt_wait_lst,...) G_GNUC_NULL_TERMINATED
Add event wrapper objects to an event wait list (variable argument list version). ...
GError CCLErr
Error handling class.
CCLEvent * ccl_event_new_wrap(cl_event event)
Get the event wrapper for the given OpenCL event.
cl_bool ccl_event_wait(CCLEventWaitList *evt_wait_lst, CCLErr **err)
Waits on the host thread for commands identified by events in the wait list to complete.
void(* ccl_event_callback)(cl_event event, cl_int event_command_exec_status, void *user_data)
Prototype for user event callback functions.