diff options
author | Junyan He <junyan.he@intel.com> | 2016-07-19 19:25:53 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-09-02 17:35:00 +0800 |
commit | ce4439635c2eb365124f1c772842fe068bac3847 (patch) | |
tree | cd5c6d04f0c673f76b9f6f1fa84c6fd3ad581516 /src/cl_event.h | |
parent | 2baff9cedf124e4efa3c718cae836f17926d81f4 (diff) | |
download | beignet-ce4439635c2eb365124f1c772842fe068bac3847.tar.gz |
Runtime: Apply base object to cl_event
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.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cl_event.h b/src/cl_event.h index 67fab190..164ca473 100644 --- a/src/cl_event.h +++ b/src/cl_event.h @@ -22,7 +22,7 @@ #include <semaphore.h> -#include "cl_internals.h" +#include "cl_base_object.h" #include "cl_driver.h" #include "cl_enqueue.h" #include "CL/cl.h" @@ -55,9 +55,7 @@ typedef struct _user_callback { } user_callback; struct _cl_event { - DEFINE_ICD(dispatch) - uint64_t magic; /* To identify it as a sampler object */ - volatile int ref_n; /* We reference count this object */ + _cl_base_object base; cl_context ctx; /* The context associated with event */ cl_event prev, next; /* We chain the memory buffers together */ cl_command_queue queue; /* The command queue associated with event */ @@ -74,6 +72,9 @@ struct _cl_event { cl_event last_next, last_prev;/* We need a list to monitor untouchable api event*/ }; +#define CL_OBJECT_EVENT_MAGIC 0x8324a9f810ebf90fLL +#define CL_OBJECT_IS_EVENT(obj) (((cl_base_object)obj)->magic == CL_OBJECT_EVENT_MAGIC) + /* Create a new event object */ cl_event cl_event_new(cl_context, cl_command_queue, cl_command_type, cl_bool); /* Unref the object and delete it if no more reference on it */ |