diff options
author | Junyan He <junyan.he@intel.com> | 2016-12-19 19:24:08 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-12-28 17:36:13 +0800 |
commit | 7ae1517cfc373847f168ffb3e41b635861af19c7 (patch) | |
tree | 2bac66f84030df207f66b22ead179b880fcd73f8 /src/cl_api.c | |
parent | 9da345181a2637b617cc3b4f7e96fa90e1731764 (diff) |
Add profiling feature based on new event implementation.
TODO:
In opencl 2.0, a new profiling item called CL_PROFILING_COMMAND_COMPLETE
is imported. It means that we need to record the time stamp of all the
child events created by the "Kernel enqueing kernels" feature finish.
This should be done after the "Kernel enqueing kernels" feature enabled.
V2:
Update event time stamp before inserting to queue thread, avoid MT issue.
V3:
Fixup overflow problem.
V4:
Fixup overflow to 0xfffffffffffffffff problem.
Just take ownership and release event lock when call the update timestamp
function. The update timestamp function may have block system call can
should not hold the lock to call it.
Signed-off-by: Junyan He <junyan.he@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'src/cl_api.c')
-rw-r--r-- | src/cl_api.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/cl_api.c b/src/cl_api.c index 943e5877..06872a59 100644 --- a/src/cl_api.c +++ b/src/cl_api.c @@ -1151,57 +1151,6 @@ error: return err; } - -cl_int -clGetEventProfilingInfo(cl_event event, - cl_profiling_info param_name, - size_t param_value_size, - void * param_value, - size_t * param_value_size_ret) -{ - cl_int err = CL_SUCCESS; - cl_ulong ret_val; - - CHECK_EVENT(event); - //cl_event_update_status(event, 0); - - if (event->event_type == CL_COMMAND_USER || - !(event->queue->props & CL_QUEUE_PROFILING_ENABLE) || - event->status != CL_COMPLETE) { - err = CL_PROFILING_INFO_NOT_AVAILABLE; - goto error; - } - - if (param_value && param_value_size < sizeof(cl_ulong)) { - err = CL_INVALID_VALUE; - goto error; - } - - if (param_name == CL_PROFILING_COMMAND_QUEUED) { - ret_val = event->queued_timestamp; - } else if (param_name == CL_PROFILING_COMMAND_SUBMIT) { - ret_val= event->queued_timestamp + cl_event_get_timestamp_delta(event->timestamp[0],event->timestamp[1]); - } else if (param_name == CL_PROFILING_COMMAND_START) { - err = cl_event_get_timestamp(event, CL_PROFILING_COMMAND_START); - ret_val = event->queued_timestamp + cl_event_get_start_timestamp(event); - } else if (param_name == CL_PROFILING_COMMAND_END) { - err = cl_event_get_timestamp(event, CL_PROFILING_COMMAND_END); - ret_val = event->queued_timestamp + cl_event_get_end_timestamp(event); - } else { - err = CL_INVALID_VALUE; - goto error; - } - - if (err == CL_SUCCESS) { - if (param_value) - *(cl_ulong*)param_value = ret_val; - if (param_value_size_ret) - *param_value_size_ret = sizeof(cl_ulong); - } -error: - return err; -} - cl_mem clCreatePipe (cl_context context, cl_mem_flags flags, cl_uint pipe_packet_size, |