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
Dependent filters

Dependent filters perform device selection based on the characteristics of all devices present in the list passed to them. More...

Collaboration diagram for Dependent filters:

Functions

CCLDevSelDevices ccl_devsel_dep_index (CCLDevSelDevices devices, void *data, CCLErr **err)
 Dependent filter function which selects the device at the specified index, failing if no device is found at that index. More...
 
CCLDevSelDevices ccl_devsel_dep_menu (CCLDevSelDevices devices, void *data, CCLErr **err)
 Dependent filter function which presents a menu to the user allowing him to select the desired device. More...
 
CCLDevSelDevices ccl_devsel_dep_platform (CCLDevSelDevices devices, void *data, CCLErr **err)
 Dependent filter function which only accepts devices of the same platform (the platform to which the first device belong to). More...
 

Detailed Description

Dependent filters perform device selection based on the characteristics of all devices present in the list passed to them.

In practice, dependent filters are functions which implement the ccl_devsel_dep prototype. Functions of this type accept a list of device wrappers and optional user data, returning a new list with the devices present in the original list and which were accepted by the filter.

cf4ocl includes several dependent filters (e.g. a filter to select devices which belong to the platform associated with the first device in the list, and a filter to select devices using a menu). Other dependent filters can be implemented by client code and used in the device selection mechanism.

Function Documentation

CCLDevSelDevices ccl_devsel_dep_index ( CCLDevSelDevices  devices,
void *  data,
CCLErr **  err 
)

Dependent filter function which selects the device at the specified index, failing if no device is found at that index.

Device indexes depend on the order in which devices appear in the devices parameter.

Parameters
[in]devicesList of devices.
[in]dataMust point to a valid device index of type cl_uint.
[out]errReturn location for a CCLErr object, or NULL if error reporting is to be ignored.
Returns
The OpenCL device which was selected by the filter.

Definition at line 1175 of file ccl_device_selector.c.

CCLDevSelDevices ccl_devsel_dep_menu ( CCLDevSelDevices  devices,
void *  data,
CCLErr **  err 
)

Dependent filter function which presents a menu to the user allowing him to select the desired device.

Parameters
[in]devicesList of devices.
[in]dataIf not NULL, can contain a device index, such that the device is automatically selected by this filter.
[out]errReturn location for a CCLErr object, or NULL if error reporting is to be ignored.
Returns
The OpenCL devices which were accepted by the filter.

Definition at line 1091 of file ccl_device_selector.c.

CCLDevSelDevices ccl_devsel_dep_platform ( CCLDevSelDevices  devices,
void *  data,
CCLErr **  err 
)

Dependent filter function which only accepts devices of the same platform (the platform to which the first device belong to).

Parameters
[in]devicesCurrently available OpenCL devices.
[in]dataFilter data, ignored.
[out]errReturn location for a CCLErr object, or NULL if error reporting is to be ignored.
Returns
The OpenCL devices which were accepted by the filter.
Examples:
device_filter.c.

Definition at line 1007 of file ccl_device_selector.c.