summaryrefslogtreecommitdiff
path: root/src/cl_event.h
diff options
context:
space:
mode:
authorJunyan He <junyan.he@intel.com>2016-12-27 18:45:22 +0800
committerYang Rong <rong.r.yang@intel.com>2016-12-28 17:36:18 +0800
commit64b8b046f2f844d292a692e788201acecb586359 (patch)
tree371bad1642b5fb6a829fd69ec3d867f763b6911b /src/cl_event.h
parent7ae1517cfc373847f168ffb3e41b635861af19c7 (diff)
downloadbeignet-64b8b046f2f844d292a692e788201acecb586359.tar.gz
Improve event execute function.
Modify the event exec function, make it as the uniformal entry for all event command execution. This will help the timestamp record and profiling feature a lot. V2: 1. Set event init state to bigger than CL_QUEUED. Event state should be set to CL_QUEUED exactly when it is to be queued. Profiling feature make this requirement clearer. We need to record the timestamp exactly when it it to be queued. So we need to add a additional state beyond CL_QUEUED. 2. Fix cl_event_update_timestamp_gen bugi, the CL_SUMITTED time may be less. GPU may record the timestamp of CL_RUNNING before CPU record timestamp of CL_SUMITTED. It is a async process and it is hard for us to control. According to SPEC, we need to record timestamp after some state is done. We can just now set CL_SUMITTED to CL_RUNNING timestamp if the CL_SUBMITTED timestamp is the bigger one. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'src/cl_event.h')
-rw-r--r--src/cl_event.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cl_event.h b/src/cl_event.h
index cb43244f..f28844af 100644
--- a/src/cl_event.h
+++ b/src/cl_event.h
@@ -57,6 +57,8 @@ typedef struct _cl_event {
((cl_base_object)obj)->magic == CL_OBJECT_EVENT_MAGIC && \
CL_OBJECT_GET_REF(obj) >= 1))
+#define CL_EVENT_STATE_UNKNOWN 0x4
+
#define CL_EVENT_IS_MARKER(E) (E->event_type == CL_COMMAND_MARKER)
#define CL_EVENT_IS_BARRIER(E) (E->event_type == CL_COMMAND_BARRIER)
#define CL_EVENT_IS_USER(E) (E->event_type == CL_COMMAND_USER)
@@ -68,7 +70,7 @@ extern cl_event cl_event_create(cl_context ctx, cl_command_queue queue, cl_uint
const cl_event *event_list, cl_command_type type, cl_int *errcode_ret);
extern cl_int cl_event_check_waitlist(cl_uint num_events_in_wait_list, const cl_event *event_wait_list,
cl_event* event, cl_context ctx);
-extern void cl_event_exec(cl_event event, cl_int exec_status);
+extern cl_uint cl_event_exec(cl_event event, cl_int exec_to_status, cl_bool ignore_depends);
/* 0 means ready, >0 means not ready, <0 means error. */
extern cl_int cl_event_is_ready(cl_event event);
extern cl_int cl_event_get_status(cl_event event);
@@ -82,5 +84,5 @@ extern cl_int cl_event_wait_for_event_ready(cl_event event);
extern cl_event cl_event_create_marker_or_barrier(cl_command_queue queue, cl_uint num_events_in_wait_list,
const cl_event *event_wait_list, cl_bool is_barrier,
cl_int* error);
-extern void cl_event_update_timestamp(cl_event event, cl_int from_status, cl_int to_status);
+extern void cl_event_update_timestamp(cl_event event, cl_int status);
#endif /* __CL_EVENT_H__ */