[Beignet] [BUG] piglit test case fail (get-global-size)
Sun, Yi
yi.sun at intel.com
Wed Jun 26 01:03:46 PDT 2013
Hi Zhigang,
This patch works well. I retested case
bin/cl-program-tester tests/cl/program/execute/get-global-size.cl
and it now is passed.
Thanks
--Sun, Yi
>
>
On Tue, 2013-06-25 at 14:34 +0800, Zhigang Gong wrote:
> On Mon, Jun 24, 2013 at 01:57:13PM +0800, Zhigang Gong wrote:
> Hi Yi,
>
> I just wrote a patch to work around this bug and optimize those
> builtin functions. Please help to test it. Thanks.
>
> From 3b5f96a9f085ce5e865008485dd9c5e6b5245bbd Mon Sep 17 00:00:00 2001
> From: Zhigang Gong <zhigang.gong at linux.intel.com>
> Date: Tue, 25 Jun 2013 14:15:09 +0800
> Subject: [PATCH] Refine the get_local_id/... builtins.
>
> As we could prepare correct value on runtime library side and give
> a correct value in the payload for dim 0, 1 and 2. So for these 3
> dim argument, we don't need to check it whether in the valid range,
> we just read the payload's value.
>
> This way, we can avoid any unecessary branching for normal usage of
> these builtin functions. And could avoid a known bool related bug.
>
> Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
> ---
> backend/src/ocl_stdlib.h | 8 +++-----
> src/cl_api.c | 2 +-
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/backend/src/ocl_stdlib.h b/backend/src/ocl_stdlib.h
> index 81a0193..f43e898 100644
> --- a/backend/src/ocl_stdlib.h
> +++ b/backend/src/ocl_stdlib.h
> @@ -4315,11 +4315,9 @@ DECL_INTERNAL_WORK_ITEM_FN(get_num_groups)
> #define DECL_PUBLIC_WORK_ITEM_FN(NAME, OTHER_RET) \
> INLINE unsigned NAME(unsigned int dim) { \
> if (dim == 0) return __gen_ocl_##NAME##0(); \
> - else if (dim > 0 && dim < get_work_dim()) { \
> - if (dim == 1) return __gen_ocl_##NAME##1(); \
> - else if (dim == 2) return __gen_ocl_##NAME##2(); \
> - } \
> - return OTHER_RET; \
> + else if (dim == 1) return __gen_ocl_##NAME##1(); \
> + else if (dim == 2) return __gen_ocl_##NAME##2(); \
> + else return OTHER_RET; \
> }
>
> DECL_PUBLIC_WORK_ITEM_FN(get_group_id, 0)
> diff --git a/src/cl_api.c b/src/cl_api.c
> index 3c78243..ebca294 100644
> --- a/src/cl_api.c
> +++ b/src/cl_api.c
> @@ -1570,7 +1570,7 @@ clEnqueueNDRangeKernel(cl_command_queue command_queue,
> {
> size_t fixed_global_off[] = {0,0,0};
> size_t fixed_global_sz[] = {1,1,1};
> - size_t fixed_local_sz[] = {16,1,1};
> + size_t fixed_local_sz[] = {1,1,1};
> cl_int err = CL_SUCCESS;
> cl_uint i;
>
More information about the Beignet
mailing list