cf4ocl (C Framework for OpenCL)
v2.1.0
Object-oriented framework for developing and benchmarking OpenCL projects in C/C++
|
This module facilitates the querying of OpenCL devices. More...
Data Structures | |
struct | ccl_devquery_map |
Maps a string to a cl_device_info bitfield. More... | |
Macros | |
#define | ccl_devquery_type2str(type) |
Map an OpenCL cl_device_type object to a string identifying the device type. More... | |
#define | ccl_devquery_type2str(type) |
Map an OpenCL cl_device_type object to a string identifying the device type. More... | |
Typedefs | |
typedef char *(* | ccl_devquery_format )(CCLWrapperInfo *info, char *out, size_t size, const char *units) |
Output formatting function. More... | |
typedef char *(* | ccl_devquery_format )(CCLWrapperInfo *info, char *out, size_t size, const char *units) |
Output formatting function. More... | |
typedef struct ccl_devquery_map | CCLDevQueryMap |
Maps a string to a cl_device_info bitfield. | |
typedef struct ccl_devquery_map | CCLDevQueryMap |
Maps a string to a cl_device_info bitfield. | |
Functions | |
gchar * | ccl_devquery_get_prefix_final (const char *prefix) |
Get a final device info prefix in the same format as kept in the ccl_devquery_info_map. More... | |
const CCLDevQueryMap * | ccl_devquery_match (const char *substr, int *idx) |
Search for a device information parameter by matching part of its name. More... | |
cl_device_info | ccl_devquery_name (const char *name) |
Return a cl_device_info object given its name. More... | |
const CCLDevQueryMap * | ccl_devquery_prefix (const char *prefix, int *size) |
Get a pointer to the first device information parameter which has the given prefix. More... | |
Variables | |
const CCLDevQueryMap | ccl_devquery_info_map [] |
Map of parameter name strings to respective cl_device_info bitfields, long description string, format output function and a units suffix. More... | |
const CCLDevQueryMap | ccl_devquery_info_map [] |
Map of parameter name strings to respective cl_device_info bitfields, long description string, format output function and a units suffix. More... | |
const int | ccl_devquery_info_map_size |
Size of parameter information map. More... | |
const int | ccl_devquery_info_map_size |
Size of parameter information map. More... | |
This module facilitates the querying of OpenCL devices.
It primarily supports the ccl_devinfo utility, but may also be of use to client code.
#define ccl_devquery_type2str | ( | type | ) |
Map an OpenCL cl_device_type object to a string identifying the device type.
[in] | type | The OpenCL cl_device_type. |
Definition at line 135 of file ccl_device_query.h.
#define ccl_devquery_type2str | ( | type | ) |
Map an OpenCL cl_device_type object to a string identifying the device type.
[in] | type | The OpenCL cl_device_type. |
Definition at line 135 of file ccl_device_query.h.
typedef char*(* ccl_devquery_format)(CCLWrapperInfo *info, char *out, size_t size, const char *units) |
Output formatting function.
[in] | info | CL device information bitfield. |
[out] | out | Char buffer (pre-allocated) were to write formatted output. |
[in] | size | Maximum output length. |
[in] | units | Parameter units suffix. |
Definition at line 58 of file ccl_device_query.h.
typedef char*(* ccl_devquery_format)(CCLWrapperInfo *info, char *out, size_t size, const char *units) |
Output formatting function.
[in] | info | CL device information bitfield. |
[out] | out | Char buffer (pre-allocated) were to write formatted output. |
[in] | size | Maximum output length. |
[in] | units | Parameter units suffix. |
Definition at line 58 of file ccl_device_query.h.
gchar * ccl_devquery_get_prefix_final | ( | const char * | prefix | ) |
Get a final device info prefix in the same format as kept in the ccl_devquery_info_map.
[in] | prefix | Raw device information prefix. Several forms are accepted. For example, for CL_DEVICE_ENDIAN_LITTLE, strings such as "CL_DEVICE_ENDIAN_LITTLE", "ENDIAN_LITTLE" or "endian_little" are accepted. |
NULL
if given prefix is not valid. Should be freed with g_free() function from GLib. Definition at line 984 of file ccl_device_query.c.
const CCLDevQueryMap * ccl_devquery_match | ( | const char * | substr, |
int * | idx | ||
) |
Search for a device information parameter by matching part of its name.
This function is supposed to be used in a loop.
[in] | substr | String to match with parameter name. |
[in,out] | idx | Next index, should be zero in the first call, and the function updates within calls. |
NULL
if search is over. Definition at line 1160 of file ccl_device_query.c.
cl_device_info ccl_devquery_name | ( | const char * | name | ) |
Return a cl_device_info
object given its name.
[in] | name | Name of cl_device_info object. Several forms are accepted. For example, for CL_DEVICE_ENDIAN_LITTLE, strings such as "CL_DEVICE_ENDIAN_LITTLE", "ENDIAN_LITTLE" or "endian_little" are accepted. |
cl_device_info
object given its name or 0 if no suitable cl_device_info
is found for the given name. Definition at line 1030 of file ccl_device_query.c.
const CCLDevQueryMap * ccl_devquery_prefix | ( | const char * | prefix, |
int * | size | ||
) |
Get a pointer to the first device information parameter which has the given prefix.
[in] | prefix | Device information parameter prefix. Can be in lower or uppercase, and start with "cl_device_" or not. |
[out] | size | Location where to put number of matching parameters, or NULL if it is to be ignored. |
NULL
if nothing found. Definition at line 1072 of file ccl_device_query.c.
const CCLDevQueryMap ccl_devquery_info_map[] |
Map of parameter name strings to respective cl_device_info bitfields, long description string, format output function and a units suffix.
Definition at line 483 of file ccl_device_query.c.
const CCLDevQueryMap ccl_devquery_info_map[] |
Map of parameter name strings to respective cl_device_info bitfields, long description string, format output function and a units suffix.
Definition at line 483 of file ccl_device_query.c.
const int ccl_devquery_info_map_size |
Size of parameter information map.
Definition at line 477 of file ccl_device_query.c.
const int ccl_devquery_info_map_size |
Size of parameter information map.
Definition at line 477 of file ccl_device_query.c.