The following patch enables the clGetContextInfo query with CL_CONTEXT_DEVICES.
Applications can query the required size of the result buffer and then request
the cl_device_id of the available devices in this context.
Signed-off-by: Mario Kicherer <dev@kicherer.org>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
void * param_value,
size_t * param_value_size_ret)
{
- NOT_IMPLEMENTED;
+ switch (param_name) {
+ case CL_CONTEXT_DEVICES:
+ if (param_value) {
+ if (param_value_size < sizeof(cl_device_id))
+ return CL_INVALID_VALUE;
+ cl_device_id *device_list = (cl_device_id*)param_value;
+ device_list[0] = context->device;
+ if (param_value_size_ret)
+ *param_value_size_ret = sizeof(cl_device_id);
+ return CL_SUCCESS;
+ }
+ if (param_value_size_ret) {
+ *param_value_size_ret = sizeof(cl_device_id);
+ return CL_SUCCESS;
+ }
+ default:
+ NOT_IMPLEMENTED;
+ }
return 0;
}