From caa3702cb2b0d745e49e3aa540f501714909b67d Mon Sep 17 00:00:00 2001 From: Dag Lem Date: Wed, 5 Jun 2013 19:57:26 +0200 Subject: [PATCH] Check for exhaustion of local memory Signed-off-by: Dag Lem Reviewed-by: Zhigang Gong --- 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 5950334..cf6bd31 100644 --- a/src/cl_command_queue_gen7.c +++ b/src/cl_command_queue_gen7.c @@ -216,8 +216,11 @@ cl_command_queue_ND_range_gen7(cl_command_queue queue, kernel.cst_sz = cst_sz; /* Curbe step 1: fill the constant buffer data shared by all threads */ - if (ker->curbe) + if (ker->curbe) { kernel.slm_sz = cl_curbe_fill(ker, work_dim, global_wk_off, global_wk_sz, local_wk_sz, thread_n); + if (kernel.slm_sz > ker->program->ctx->device->local_mem_size) + return CL_OUT_OF_RESOURCES; + } /* Setup the kernel */ cl_gpgpu_state_init(gpgpu, ctx->device->max_compute_unit, cst_sz / 32); -- 2.7.4