[Beignet] [Patch V2] Refine the the error handling in function cl_command_queue_ND_range_gen7.
Zhigang Gong
zhigang.gong at linux.intel.com
Thu Oct 16 21:29:47 PDT 2014
This version LGTM, pushed, thanks.
On Fri, Oct 17, 2014 at 11:04:16AM +0800, Yang Rong wrote:
> Return error code when work group error, and remove printf and exit(-1) when internal error..
>
> Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> ---
> src/cl_command_queue_gen7.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/cl_command_queue_gen7.c b/src/cl_command_queue_gen7.c
> index b020540..d847806 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;
>
> @@ -395,8 +398,7 @@ cl_command_queue_ND_range_gen7(cl_command_queue queue,
> return CL_SUCCESS;
>
> error:
> - fprintf(stderr, "error occured. \n");
> - exit(-1);
> + /* only some command/buffer internal error reach here, so return error code OOR */
> return CL_OUT_OF_RESOURCES;
> }
>
> --
> 1.8.3.2
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list