[Beignet] [PATCH] fix piglit clGetKernelWorkGroupInfo fail.
xionghu.luo at intel.com
xionghu.luo at intel.com
Mon Sep 8 18:36:58 PDT 2014
From: Luo Xionghu <xionghu.luo at intel.com>
add CL_KERNEL_GLOBAL_WORK_SIZE option for clGetKernelWorkGroupInfo.
Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
src/cl_api.c | 3 +++
src/cl_device_id.c | 1 +
src/cl_kernel.h | 2 ++
3 files changed, 6 insertions(+)
diff --git a/src/cl_api.c b/src/cl_api.c
index 2370dc0..07e8954 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -2965,6 +2965,9 @@ clEnqueueNDRangeKernel(cl_command_queue command_queue,
}
}
+ for (i = 0; i < work_dim; ++i)
+ kernel->global_work_sz[i] = fixed_global_sz[i];
+
/* Do device specific checks are enqueue the kernel */
err = cl_command_queue_ND_range(command_queue,
kernel,
diff --git a/src/cl_device_id.c b/src/cl_device_id.c
index a0f0c99..6bd80a6 100644
--- a/src/cl_device_id.c
+++ b/src/cl_device_id.c
@@ -573,6 +573,7 @@ cl_get_kernel_workgroup_info(cl_kernel kernel,
}
DECL_FIELD(COMPILE_WORK_GROUP_SIZE, kernel->compile_wg_sz)
DECL_FIELD(PRIVATE_MEM_SIZE, kernel->stack_size)
+ DECL_FIELD(GLOBAL_WORK_SIZE, kernel->global_work_sz)
default:
return CL_INVALID_VALUE;
};
diff --git a/src/cl_kernel.h b/src/cl_kernel.h
index f4ed8d3..85a997d 100644
--- a/src/cl_kernel.h
+++ b/src/cl_kernel.h
@@ -59,6 +59,8 @@ struct _cl_kernel {
cl_ulong local_mem_sz; /* local memory size specified in kernel args. */
size_t compile_wg_sz[3]; /* Required workgroup size by __attribute__((reqd_work_gro
up_size(X, Y, Z))) qualifier.*/
+ size_t global_work_sz[3]; /* maximum global size that can be used to execute a kernel
+ (i.e. global_work_size argument to clEnqueueNDRangeKernel.)*/
size_t stack_size; /* stack size per work item. */
cl_argument *args; /* To track argument setting */
uint32_t arg_n:31; /* Number of arguments */
--
1.7.9.5
More information about the Beignet
mailing list