diff options
author | Yang Rong <rong.r.yang@intel.com> | 2016-12-30 17:50:56 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-12-30 18:25:01 +0800 |
commit | 5d9a8cacce11d4c3edd0cde7c8eaffde9a6e0abb (patch) | |
tree | 7acd0b21e2efba2a6d29be70d4228bf70c339623 /src | |
parent | 86b092aedf311b39ada5e86c39d4052fba42fc66 (diff) | |
download | beignet-5d9a8cacce11d4c3edd0cde7c8eaffde9a6e0abb.tar.gz |
Runtime: fix a profiling fail.
cl_event_exec it the uniformal entry for all event command execution,
call cl_enqueue_handle may miss time stamp record.
Replace all cl_enqueue_handle to cl_event_exec.
Signed-off-by: Yang Rong <rong.r.yang@intel.com>
Reviewed-by: Pan Xiuli <xiuli.pan@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/cl_api.c | 18 | ||||
-rw-r--r-- | src/cl_api_event.c | 8 | ||||
-rw-r--r-- | src/cl_api_kernel.c | 3 |
3 files changed, 6 insertions, 23 deletions
diff --git a/src/cl_api.c b/src/cl_api.c index 51b0c677..55cfd4e8 100644 --- a/src/cl_api.c +++ b/src/cl_api.c @@ -277,14 +277,10 @@ clEnqueueSVMFree (cl_command_queue command_queue, data->ptr = user_data; if (e_status == CL_COMPLETE) { // No need to wait - err = cl_enqueue_handle(data, CL_COMPLETE); + err = cl_event_exec(e, CL_COMPLETE, CL_FALSE); if (err != CL_SUCCESS) { - assert(err < 0); - e->status = err; break; } - - e->status = CL_COMPLETE; } else { // May need to wait some event to complete. cl_command_queue_enqueue_event(command_queue, e); } @@ -422,14 +418,10 @@ cl_int clEnqueueSVMMemcpy (cl_command_queue command_queue, data->size = size; if (e_status == CL_COMPLETE) { // No need to wait - err = cl_enqueue_handle(data, CL_COMPLETE); + err = cl_event_exec(e, CL_COMPLETE, CL_FALSE); if (err != CL_SUCCESS) { - assert(err < 0); - e->status = err; break; } - - e->status = CL_COMPLETE; } else { // May need to wait some event to complete. cl_command_queue_enqueue_event(command_queue, e); } @@ -510,14 +502,10 @@ cl_int clEnqueueSVMMemFill (cl_command_queue command_queue, data->size = size; if (e_status == CL_COMPLETE) { // No need to wait - err = cl_enqueue_handle(data, CL_COMPLETE); + err = cl_event_exec(e, CL_COMPLETE, CL_FALSE); if (err != CL_SUCCESS) { - assert(err < 0); - e->status = err; break; } - - e->status = CL_COMPLETE; } else { // May need to wait some event to complete. cl_command_queue_enqueue_event(command_queue, e); } diff --git a/src/cl_api_event.c b/src/cl_api_event.c index af1442ae..9207021c 100644 --- a/src/cl_api_event.c +++ b/src/cl_api_event.c @@ -105,12 +105,10 @@ clEnqueueMarkerWithWaitList(cl_command_queue command_queue, err = CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST; break; } else if (e_status == CL_COMPLETE) { - err = cl_enqueue_handle(&e->exec_data, CL_COMPLETE); + err = cl_event_exec(e, CL_COMPLETE, CL_FALSE); if (err != CL_SUCCESS) { break; } - - e->status = CL_COMPLETE; } else { cl_command_queue_enqueue_event(command_queue, e); } @@ -164,12 +162,10 @@ clEnqueueBarrierWithWaitList(cl_command_queue command_queue, err = CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST; break; } else if (e_status == CL_COMPLETE) { - err = cl_enqueue_handle(&e->exec_data, CL_COMPLETE); + err = cl_event_exec(e, CL_COMPLETE, CL_FALSE); if (err != CL_SUCCESS) { break; } - - e->status = CL_COMPLETE; /* Already a completed barrier, no need to insert to queue. */ } else { cl_command_queue_insert_barrier_event(command_queue, e); diff --git a/src/cl_api_kernel.c b/src/cl_api_kernel.c index 7799ecb1..863b47f9 100644 --- a/src/cl_api_kernel.c +++ b/src/cl_api_kernel.c @@ -266,11 +266,10 @@ clEnqueueNDRangeKernel(cl_command_queue command_queue, err = CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST; break; } else if (event_status == CL_COMPLETE) { - err = cl_enqueue_handle(&e->exec_data, CL_SUBMITTED); + err = cl_event_exec(e, CL_SUBMITTED, CL_FALSE); if (err != CL_SUCCESS) { break; } - e->status = CL_SUBMITTED; } cl_command_queue_enqueue_event(command_queue, e); |