diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2015-04-10 09:54:49 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-04-10 16:21:38 +0800 |
commit | 4c530f94ee4e016e32997bb60f7f74589301b412 (patch) | |
tree | f1abd2bb2e14216efeeda9b5c75dd5af83dc208c /src/cl_event.c | |
parent | ee2c51cddd03c8d22c38612ec1bc40637d84b22d (diff) |
runtime: Enhance the error handling when flush gpgpu command queue.
Beignet uses drm_intel_gem_bo_context_exec() to flush command queue to
linux drm driver layer. We need to check the return value of that function,
as it may fail when the application uses very large array.
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
Diffstat (limited to 'src/cl_event.c')
-rw-r--r-- | src/cl_event.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cl_event.c b/src/cl_event.c index bba14bac..b4734b22 100644 --- a/src/cl_event.c +++ b/src/cl_event.c @@ -46,16 +46,18 @@ cl_event_is_gpu_command_type(cl_command_type type) } } -void cl_event_flush(cl_event event) +int cl_event_flush(cl_event event) { + int err = CL_SUCCESS; assert(event->gpgpu_event != NULL); if (event->gpgpu) { - cl_command_queue_flush_gpgpu(event->queue, event->gpgpu); + err = cl_command_queue_flush_gpgpu(event->queue, event->gpgpu); cl_gpgpu_delete(event->gpgpu); event->gpgpu = NULL; } cl_gpgpu_event_flush(event->gpgpu_event); event->queue->last_event = event; + return err; } cl_event cl_event_new(cl_context ctx, cl_command_queue queue, cl_command_type type, cl_bool emplict) |