Skip to content
Snippets Groups Projects
Commit 7aaa9032 authored by Yichao Yu's avatar Yichao Yu
Browse files

Event.set_support_cb

parent 540e17d3
No related branches found
No related tags found
No related merge requests found
......@@ -140,6 +140,7 @@ type_t image__get_fill_type(clobj_t img);
error *event__get_profiling_info(clobj_t event, cl_profiling_info param,
generic_info *out);
error *event__wait(clobj_t event);
void event__set_support_cb(clobj_t _evt, int support);
error *event__set_callback(clobj_t _evt, cl_int type, void *pyobj);
error *wait_for_events(const clobj_t *_wait_for, uint32_t num_wait_for);
// Nanny Event
......
......@@ -883,6 +883,17 @@ class Kernel(_Common):
class Event(_Common):
_id = 'event'
@classmethod
def _create(cls, ptr):
self = _Common._create.__func__(cls, ptr)
try:
if (self.context._get_cl_version() >= (1, 1) and
get_cl_header_version() >= (1, 1)):
_lib.event__set_support_cb(ptr, 1);
except:
pass
return self
def __init__(self):
pass
......
......@@ -198,6 +198,13 @@ event__wait(clobj_t evt)
}
#if PYOPENCL_CL_VERSION >= 0x1010
void
event__set_support_cb(clobj_t _evt, int support)
{
auto evt = static_cast<event*>(_evt);
evt->support_cb = support;
}
error*
event__set_callback(clobj_t _evt, cl_int type, void *pyobj)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment