It's better to fix the general error code check and returning logic in
function cl_command_queue_ND_range_gen7(). Please check the following
problematic code at the end of the function.

  error:
    fprintf(stderr, "error occured. \n");
    exit(-1);
    return CL_OUT_OF_RESOURCES;

Which is obviously incorrect way in a library. Please fix this issue there
rather than only fix it for the work group size case.

Thanks,
Zhigang Gong.


On Thu, Oct 16, 2014 at 04:00:33PM +0800, Yang Rong wrote:
> Signed-off-by: Yang Rong <[email protected]>
> ---
>  src/cl_command_queue_gen7.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/cl_command_queue_gen7.c b/src/cl_command_queue_gen7.c
> index b020540..c11e25d 100644
> --- a/src/cl_command_queue_gen7.c
> +++ b/src/cl_command_queue_gen7.c
> @@ -317,7 +317,10 @@ cl_command_queue_ND_range_gen7(cl_command_queue queue,
>    kernel.use_slm = interp_kernel_use_slm(ker->opaque);
>  
>    /* Compute the number of HW threads we need */
> -  TRY (cl_kernel_work_group_sz, ker, local_wk_sz, 3, &local_sz);
> +  if(UNLIKELY(err = cl_kernel_work_group_sz(ker, local_wk_sz, 3, &local_sz) 
> != CL_SUCCESS)) {
> +    fprintf(stderr, "Beignet: Work group size exceed Kerne's work group 
> size.\n");
> +    return err;
> +  }
>    kernel.thread_n = thread_n = (local_sz + simd_sz - 1) / simd_sz;
>    kernel.curbe_sz = cst_sz;
>  
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Beignet mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to