cf4ocl (C Framework for OpenCL)  v2.1.0
Object-oriented framework for developing and benchmarking OpenCL projects in C/C++
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Event wait lists

This module provides simple management of event wait lists. More...

Collaboration diagram for Event wait lists:

Macros

#define ccl_ewl   ccl_event_wait_list_add
 Alias the for the ccl_event_wait_list_add() function. More...
 
#define ccl_ewl   ccl_event_wait_list_add
 Alias the for the ccl_event_wait_list_add() function. More...
 

Typedefs

typedef GPtrArray * CCLEventWaitList
 A list of event objects on which enqueued commands can wait. More...
 
typedef GPtrArray * CCLEventWaitList
 A list of event objects on which enqueued commands can wait. More...
 

Functions

CCLEventWaitListccl_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). More...
 
CCLEventWaitListccl_event_wait_list_add_v (CCLEventWaitList *evt_wait_lst, CCLEvent **evt)
 Add event wrapper objects to an event wait list (array version). More...
 
void ccl_event_wait_list_clear (CCLEventWaitList *evt_wait_lst)
 Clears an event wait list. More...
 

Detailed Description

This module provides simple management of event wait lists.

Client code must initialize CCLEventWaitList variables to NULL, and can reuse them between ccl_*_enqueue_*() function calls. No allocation and deallocation of events and event wait lists is required if populated event wait lists are consumed by ccl_*_enqueue_*() functions; otherwise, unused non-empty event wait lists should be freed with the ccl_event_wait_list_clear() function.

Example 1:

CCLEvent *evt1, *evt2, *evt3;
CCLEventWaitList evt_wait_lst = NULL;
evt1 = ccl_buffer_enqueue_write(cq, a_dev, CL_FALSE, 0, size, a_host, NULL, NULL);
evt2 = ccl_buffer_enqueue_write(cq, b_dev, CL_FALSE, 0, size, b_host, NULL, NULL);
ccl_event_wait_list_add(&evt_wait_lst, evt1, evt2, NULL);
evt3 = ccl_kernel_enqueue_ndrange(krnl, cq, dim, offset, gws, lws, &evt_wait_lst, NULL);
ccl_event_wait_list_add(&evt_wait_lst, evt3, NULL);
ccl_buffer_enqueue_read(cq, c_dev, CL_TRUE, 0, size, c_host, &evt_wait_lst, NULL);

Example 2:

CCLEvent *evt = NULL;
CCLEventWaitList evt_wait_lst = NULL;
evt = ccl_buffer_enqueue_write(cq1, dev, CL_FALSE, 0, size, a_host, NULL, NULL);
ccl_kernel_enqueue_ndrange(krnl, cq2, dim, offset, gws, lws,
ccl_ewl(&evt_wait_lst, evt, NULL), NULL);

Macro Definition Documentation

#define ccl_ewl   ccl_event_wait_list_add

Alias the for the ccl_event_wait_list_add() function.

Intended as a shortcut to use ccl_event_wait_list_add() directly in ccl_*_enqueue_*() functions.

Definition at line 331 of file ccl_event_wrapper.h.

#define ccl_ewl   ccl_event_wait_list_add

Alias the for the ccl_event_wait_list_add() function.

Intended as a shortcut to use ccl_event_wait_list_add() directly in ccl_*_enqueue_*() functions.

Definition at line 331 of file ccl_event_wrapper.h.

Typedef Documentation

typedef GPtrArray* CCLEventWaitList

A list of event objects on which enqueued commands can wait.

Definition at line 324 of file ccl_event_wrapper.h.

typedef GPtrArray* CCLEventWaitList

A list of event objects on which enqueued commands can wait.

Definition at line 324 of file ccl_event_wrapper.h.

Function Documentation

CCLEventWaitList * ccl_event_wait_list_add ( CCLEventWaitList evt_wait_lst,
  ... 
)

Add event wrapper objects to an event wait list (variable argument list version).

Parameters
[out]evt_wait_lstEvent wait list.
[in]...A NULL-terminated list of event wrapper objects.
Returns
Event wait list populated with the given events.
Examples:
ca.c, and canon.c.

Definition at line 722 of file ccl_event_wrapper.c.

CCLEventWaitList * ccl_event_wait_list_add_v ( CCLEventWaitList evt_wait_lst,
CCLEvent **  evts 
)

Add event wrapper objects to an event wait list (array version).

Parameters
[out]evt_wait_lstEvent wait list.
[in]evtsNULL-terminated array of event wrapper objects.
Returns
Event wait list populated with the given events.

Definition at line 768 of file ccl_event_wrapper.c.

void ccl_event_wait_list_clear ( CCLEventWaitList evt_wait_lst)

Clears an event wait list.

This function will rarely be called from client code because event wait lists are automatically cleared when passed to ccl_*_enqueue_*() functions.

Parameters
[out]evt_wait_lstEvent wait list.

Definition at line 807 of file ccl_event_wrapper.c.