[Beignet] [PATCH] Runtime: Fix null device for clGetKernelWorkGroupInfo

Xiuli Pan xiuli.pan at intel.com
Fri Aug 19 09:46:12 UTC 2016


From: Pan Xiuli <xiuli.pan at intel.com>

The device arg for API clGetKernelWorkGroupInfo can be NULL.

Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
---
 src/cl_device_id.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/cl_device_id.c b/src/cl_device_id.c
index d29138d..08cc0c0 100644
--- a/src/cl_device_id.c
+++ b/src/cl_device_id.c
@@ -1157,6 +1157,8 @@ cl_get_kernel_workgroup_info(cl_kernel kernel,
 {
   int err = CL_SUCCESS;
   int dimension = 0;
+  if (device == NULL)
+    device = kernel->program->ctx->device;
   if (UNLIKELY(is_gen_device(device) == CL_FALSE))
     return CL_INVALID_DEVICE;
 
-- 
2.7.4



More information about the Beignet mailing list