cf4ocl (C Framework for OpenCL)
v2.1.0
Object-oriented framework for developing and benchmarking OpenCL projects in C/C++
|
Independent filters perform device selection based on per-device characteristics. More...
Functions | |
cl_bool | ccl_devsel_indep_platform (CCLDevice *device, void *data, CCLErr **err) |
Independent filter function which only accepts devices of a specified platform. More... | |
cl_bool | ccl_devsel_indep_string (CCLDevice *dev, void *data, CCLErr **err) |
Independent filter which selects devices based on device name, device vendor and/or platform name. More... | |
cl_bool | ccl_devsel_indep_type (CCLDevice *dev, void *data, CCLErr **err) |
Independent filter function which accepts devices of the type given in the data parameter. More... | |
cl_bool | ccl_devsel_indep_type_accel (CCLDevice *dev, void *data, CCLErr **err) |
Independent filter function which only accepts accelerator devices. More... | |
cl_bool | ccl_devsel_indep_type_cpu (CCLDevice *dev, void *data, CCLErr **err) |
Independent filter function which only accepts CPU devices. More... | |
cl_bool | ccl_devsel_indep_type_gpu (CCLDevice *dev, void *data, CCLErr **err) |
Independent filter function which only accepts GPU devices. More... | |
Independent filters perform device selection based on per-device characteristics.
Devices can be selected by type, name, or using whatever information can be obtained with the device info macros. In practice, independent filters are functions which implement the ccl_devsel_indep prototype. Functions of this type accept a device wrapper and optional user data, returning CL_TRUE
if the device is accepted by the filter, or CL_FALSE
otherwise.
cf4ocl includes several independent filters (e.g. filter by type, by name or by platform), but more can be easily implemented and used in the device selection mechanism.
Independent filter function which only accepts devices of a specified platform.
[in] | device | OpenCL device to filter by platform. |
[in] | data | Filter data, must be a cl_platform_id. |
[out] | err | Return location for a CCLErr object, or NULL if error reporting is to be ignored. |
CL_TRUE
if device belongs to the specified platform, CL_FALSE
otherwise (or if an error occurs). Definition at line 940 of file ccl_device_selector.c.
Independent filter which selects devices based on device name, device vendor and/or platform name.
[in] | dev | OpenCL device to filter by platform. |
[in] | data | Filter data, must be a string. |
[out] | err | Return location for a CCLErr object, or NULL if error reporting is to be ignored. |
CL_TRUE
if device is accepted by filter, CL_FALSE
otherwise. Definition at line 825 of file ccl_device_selector.c.
Independent filter function which accepts devices of the type given in the data parameter.
This function is used by the ccl_devsel_indep_type_*()
group of functions. Using these is simpler than using this function directly.
[in] | dev | OpenCL device to filter depending on type. |
[in] | data | Filter data, must point to a cl_device_type value. |
[out] | err | Return location for a CCLErr object, or NULL if error reporting is to be ignored. |
CL_TRUE
if device is of the given type, CL_FALSE
otherwise. Definition at line 698 of file ccl_device_selector.c.
Independent filter function which only accepts accelerator devices.
[in] | dev | OpenCL device to check for accelerator type. |
[in] | data | Filter data, ignored. |
[out] | err | Return location for a CCLErr object, or NULL if error reporting is to be ignored. |
CL_TRUE
if device is a accelerator, CL_FALSE
otherwise. Definition at line 800 of file ccl_device_selector.c.
Independent filter function which only accepts CPU devices.
[in] | dev | OpenCL device to check for CPU type. |
[in] | data | Filter data, ignored. |
[out] | err | Return location for a CCLErr object, or NULL if error reporting is to be ignored. |
CL_TRUE
if device is a CPU, CL_FALSE
otherwise. Definition at line 775 of file ccl_device_selector.c.
Independent filter function which only accepts GPU devices.
[in] | dev | OpenCL device to check for GPU type. |
[in] | data | Filter data, ignored. |
[out] | err | Return location for a CCLErr object, or NULL if error reporting is to be ignored. |
CL_TRUE
if device is a GPU, CL_FALSE
otherwise. Definition at line 751 of file ccl_device_selector.c.