aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGil Pitney <gil.pitney@linaro.org>2015-10-01 02:20:11 +0000
committerGil Pitney <gil.pitney@linaro.org>2015-10-01 02:20:11 +0000
commit2e55588f322f5eebdee567d5ef524ca60b9d7702 (patch)
tree233a6e1fb5327fc99ab2373be53527686bfb7670
parent9db2ff6976b93e0c4447c70f1ce7fc6c84ed226b (diff)
downloadshamrock-2e55588f322f5eebdee567d5ef524ca60b9d7702.tar.gz
ICD: Update Event objects to be ICD compatible.
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
-rw-r--r--src/api/api_enqueue.cpp68
-rw-r--r--src/api/api_event.cpp38
-rw-r--r--src/api/api_profiling.cpp4
-rw-r--r--src/core/commandqueue.cpp23
-rw-r--r--src/core/commandqueue.h10
-rw-r--r--src/core/dsp/worker.cpp2
-rw-r--r--src/core/events.cpp54
-rw-r--r--src/core/events.h54
8 files changed, 136 insertions, 117 deletions
diff --git a/src/api/api_enqueue.cpp b/src/api/api_enqueue.cpp
index 4ad1850..daa24cc 100644
--- a/src/api/api_enqueue.cpp
+++ b/src/api/api_enqueue.cpp
@@ -40,17 +40,20 @@
#include <cstdlib>
#include <stdio.h>
+using namespace Coal;
+
static inline cl_int queueEvent(Coal::CommandQueue *queue,
Coal::Event *command,
cl_event *event,
cl_bool blocking)
{
cl_int rs;
- Coal::Event *old_event = NULL;
if (event)
{
#if 0
+ Coal::Event *old_event = NULL;
+
/*---------------------------------------------------------------------
* It is up to the user to release events for reuse. If they do not
* they will have a memory leak for old events. This can impact
@@ -61,9 +64,9 @@ static inline cl_int queueEvent(Coal::CommandQueue *queue,
* We should also reduce the reference count of the old event, because
* user_app_event is now interested in a different event.
*--------------------------------------------------------------------*/
- old_event = *event;
+ old_event = pobj(*event);
if (old_event != NULL && old_event->isA(Coal::Object::T_Event))
- clReleaseEvent((cl_event)old_event);
+ clReleaseEvent(desc(old_event));
#endif
/*---------------------------------------------------------------------
@@ -73,7 +76,7 @@ static inline cl_int queueEvent(Coal::CommandQueue *queue,
* before we get here, command would have been cleaned from queue and
* deleted!!! Thus we will be left with a dangling pointer.
*--------------------------------------------------------------------*/
- *event = (cl_event)command;
+ *event = desc((Coal::Event *)command);
command->reference();
}
@@ -92,7 +95,8 @@ static inline cl_int queueEvent(Coal::CommandQueue *queue,
if (blocking)
{
- rs = clWaitForEvents(1, (cl_event *)&command);
+ cl_event d_event = desc((Event *)command);
+ rs = clWaitForEvents(1, &d_event);
if (rs != CL_SUCCESS)
{
@@ -127,7 +131,7 @@ clEnqueueReadBuffer(cl_command_queue d_command_queue,
command_queue,
(Coal::MemObject *)buffer,
offset, cb, ptr,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -160,7 +164,7 @@ clEnqueueWriteBuffer(cl_command_queue d_command_queue,
command_queue,
(Coal::MemObject *)buffer,
offset, cb, (void *)ptr,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -199,7 +203,7 @@ clEnqueueReadBufferRect(cl_command_queue d_command_queue,
(Coal::MemObject *)buffer,
buffer_origin, host_origin, region, buffer_row_pitch, buffer_slice_pitch,
host_row_pitch, host_slice_pitch, ptr,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -238,7 +242,7 @@ clEnqueueWriteBufferRect(cl_command_queue d_command_queue,
(Coal::MemObject *)buffer,
buffer_origin, host_origin, region, buffer_row_pitch, buffer_slice_pitch,
host_row_pitch, host_slice_pitch, (void *)ptr,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -277,7 +281,7 @@ clEnqueueCopyBufferRect(cl_command_queue d_command_queue,
(Coal::MemObject *)dst_buffer,
src_origin, dst_origin, region, src_row_pitch, src_slice_pitch,
dst_row_pitch, dst_slice_pitch, 1,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -311,7 +315,7 @@ clEnqueueCopyBuffer(cl_command_queue d_command_queue,
(Coal::MemObject *)src_buffer,
(Coal::MemObject *)dst_buffer,
src_offset, dst_offset, cb,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -344,7 +348,7 @@ clEnqueueFillBuffer(cl_command_queue d_command_queue,
command_queue,
(Coal::MemObject *)buffer,
pattern, pattern_size, offset, size,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs);
+ num_events_in_wait_list, event_wait_list, &rs);
if (rs != CL_SUCCESS)
{
@@ -382,7 +386,7 @@ clEnqueueReadImage(cl_command_queue d_command_queue,
command_queue,
(Coal::Image2D *)image,
origin, region, row_pitch, slice_pitch, (void *)ptr,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -417,7 +421,7 @@ clEnqueueWriteImage(cl_command_queue d_command_queue,
command_queue,
(Coal::Image2D *)image,
origin, region, row_pitch, slice_pitch, (void *)ptr,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -450,7 +454,7 @@ clEnqueueCopyImage(cl_command_queue d_command_queue,
command_queue,
(Coal::Image2D *)src_image, (Coal::Image2D *)dst_image,
src_origin, dst_origin, region,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -483,7 +487,7 @@ clEnqueueCopyImageToBuffer(cl_command_queue d_command_queue,
command_queue,
(Coal::Image2D *)src_image, (Coal::MemObject *)dst_buffer,
src_origin, region, dst_offset,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -516,7 +520,7 @@ clEnqueueCopyBufferToImage(cl_command_queue d_command_queue,
command_queue,
(Coal::MemObject *)src_buffer, (Coal::Image2D *)dst_image,
src_offset, dst_origin, region,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -558,7 +562,7 @@ clEnqueueMapBuffer(cl_command_queue d_command_queue,
command_queue,
(Coal::MemObject *)buffer,
offset, cb, map_flags,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, errcode_ret
+ num_events_in_wait_list, event_wait_list, errcode_ret
);
if (*errcode_ret != CL_SUCCESS)
@@ -584,7 +588,7 @@ clEnqueueMapBuffer(cl_command_queue d_command_queue,
{
void *rs = command->ptr();
- clReleaseEvent((cl_event)command);
+ clReleaseEvent(desc((Event *)command));
return rs;
}
@@ -622,7 +626,7 @@ clEnqueueMapImage(cl_command_queue d_command_queue,
command_queue,
(Coal::Image2D *)image,
map_flags, origin, region,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, errcode_ret
+ num_events_in_wait_list, event_wait_list, errcode_ret
);
if (*errcode_ret != CL_SUCCESS)
@@ -656,7 +660,7 @@ clEnqueueMapImage(cl_command_queue d_command_queue,
void *rs = command->ptr();
- clReleaseEvent((cl_event)command);
+ clReleaseEvent(desc((Event *)command));
return rs;
}
@@ -682,7 +686,7 @@ clEnqueueUnmapMemObject(cl_command_queue d_command_queue,
command_queue,
(Coal::MemObject *)memobj,
mapped_ptr,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -718,7 +722,7 @@ clEnqueueNDRangeKernel(cl_command_queue d_command_queue,
command_queue,
kernel,
work_dim, global_work_offset, global_work_size, local_work_size,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -749,7 +753,7 @@ clEnqueueTask(cl_command_queue d_command_queue,
Coal::TaskEvent *command = new Coal::TaskEvent(
command_queue,
kernel,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -783,7 +787,7 @@ clEnqueueNativeKernel(cl_command_queue d_command_queue,
command_queue,
user_func, args, cb_args, num_mem_objects,
(const Coal::MemObject **)mem_list, args_mem_loc,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs
+ num_events_in_wait_list, event_wait_list, &rs
);
if (rs != CL_SUCCESS)
@@ -823,7 +827,7 @@ clEnqueueWaitForEvents(cl_command_queue d_command_queue,
Coal::WaitForEventsEvent *command = new Coal::WaitForEventsEvent(
command_queue,
- num_events, (const Coal::Event **)event_list, &rs);
+ num_events, event_list, &rs);
if (rs != CL_SUCCESS)
{
@@ -856,6 +860,7 @@ clEnqueueMarkerWithWaitList(cl_command_queue d_command_queue,
unsigned int count;
Coal::Event **events;
auto command_queue = pobj(d_command_queue);
+ cl_event * e_wait_list = NULL;
if (!command_queue->isA(Coal::Object::T_CommandQueue))
return CL_INVALID_COMMAND_QUEUE;
@@ -868,15 +873,17 @@ clEnqueueMarkerWithWaitList(cl_command_queue d_command_queue,
if (event_wait_list) {
count = num_events_in_wait_list;
- events = (Coal::Event **)event_wait_list;
+ e_wait_list = (cl_event *)event_wait_list;
}
else {
// Get the events in command_queue
events = command_queue->events(count, false);
+ e_wait_list = (cl_event *)std::malloc(count * sizeof(cl_event));
+ desc_list(e_wait_list, events, count);
}
Coal::MarkerEvent *command = new Coal::MarkerEvent(
- command_queue, count, (const Coal::Event **)events, &rs);
+ command_queue, count, e_wait_list, &rs);
if (rs != CL_SUCCESS)
{
@@ -891,6 +898,7 @@ clEnqueueMarkerWithWaitList(cl_command_queue d_command_queue,
events[i]->dereference();
}
if (events != NULL) std::free(events);
+ if (e_wait_list != NULL) std::free(e_wait_list);
}
return queueEvent(command_queue, command, event, false);
@@ -913,7 +921,7 @@ clEnqueueBarrierWithWaitList(cl_command_queue d_command_queue,
Coal::BarrierEvent *command = new Coal::BarrierEvent(
command_queue, num_events_in_wait_list,
- (const Coal::Event **)event_wait_list, &rs);
+ event_wait_list, &rs);
if (rs != CL_SUCCESS)
{
@@ -942,7 +950,7 @@ clEnqueueMigrateMemObjects(cl_command_queue d_command_queue,
Coal::MigrateMemObjectsEvent *command = new Coal::MigrateMemObjectsEvent(
command_queue,
num_mem_objects, (const Coal::MemObject **)mem_objects, flags,
- num_events_in_wait_list, (const Coal::Event **)event_wait_list, &rs);
+ num_events_in_wait_list, event_wait_list, &rs);
if (rs != CL_SUCCESS)
{
diff --git a/src/api/api_event.cpp b/src/api/api_event.cpp
index 94c6ce4..9f94011 100644
--- a/src/api/api_event.cpp
+++ b/src/api/api_event.cpp
@@ -52,22 +52,23 @@ clWaitForEvents(cl_uint num_events,
for (cl_uint i=0; i<num_events; ++i)
{
- if (!event_list[i]->isA(Coal::Object::T_Event))
+ auto event = pobj(event_list[i]);
+ if (!event->isA(Coal::Object::T_Event))
return CL_INVALID_EVENT;
- if (event_list[i]->status() < 0)
+ if (event->status() < 0)
return CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST;
Context * evt_ctx;
- if (event_list[i]->type() == Coal::Event::User) {
- evt_ctx = ((Coal::UserEvent *)event_list[i])->context();
+ if (event->type() == Coal::Event::User) {
+ evt_ctx = ((Coal::UserEvent *)event)->context();
}
else {
- evt_ctx = (Context *)(event_list[i]->parent()->parent());
+ evt_ctx = (Context *)(event->parent()->parent());
}
#if 0 // YUAN: no need to wait for queue to be flushed
- Coal::CommandQueue * evt_queue = (Coal::CommandQueue *)event_list[i]->parent();
+ Coal::CommandQueue * evt_queue = (Coal::CommandQueue *)event->parent();
// Flush the queue
evt_queue->flush();
#endif
@@ -81,19 +82,22 @@ clWaitForEvents(cl_uint num_events,
// Wait for the events
for (cl_uint i=0; i<num_events; ++i)
{
- event_list[i]->waitForStatus(CL_COMPLETE);
+ auto event = pobj(event_list[i]);
+ event->waitForStatus(CL_COMPLETE);
}
return CL_SUCCESS;
}
cl_int
-clGetEventInfo(cl_event event,
+clGetEventInfo(cl_event d_event,
cl_event_info param_name,
size_t param_value_size,
void * param_value,
size_t * param_value_size_ret)
{
+ auto event = pobj(d_event);
+
if (!event->isA(Coal::Object::T_Event))
return CL_INVALID_EVENT;
@@ -102,13 +106,15 @@ clGetEventInfo(cl_event event,
}
cl_int
-clSetEventCallback(cl_event event,
+clSetEventCallback(cl_event d_event,
cl_int command_exec_callback_type,
void (CL_CALLBACK *pfn_event_notify)(cl_event event,
cl_int exec_status,
void *user_data),
void *user_data)
{
+ auto event = pobj(d_event);
+
if (!event->isA(Coal::Object::T_Event))
return CL_INVALID_EVENT;
@@ -124,8 +130,10 @@ clSetEventCallback(cl_event event,
}
cl_int
-clRetainEvent(cl_event event)
+clRetainEvent(cl_event d_event)
{
+ auto event = pobj(d_event);
+
if (!event->isA(Coal::Object::T_Event))
return CL_INVALID_EVENT;
@@ -135,8 +143,10 @@ clRetainEvent(cl_event event)
}
cl_int
-clReleaseEvent(cl_event event)
+clReleaseEvent(cl_event d_event)
{
+ auto event = pobj(d_event);
+
if (!event->isA(Coal::Object::T_Event))
return CL_INVALID_EVENT;
@@ -175,14 +185,14 @@ clCreateUserEvent(cl_context d_context,
return 0;
}
- return (cl_event)command;
+ return desc(command);
}
cl_int
-clSetUserEventStatus(cl_event event,
+clSetUserEventStatus(cl_event d_event,
cl_int execution_status)
{
- Coal::Event *command = (Coal::Event *)event;
+ auto command = pobj(d_event);
if (!command->isA(Coal::Object::T_Event) ||
command->type() != Coal::Event::User)
diff --git a/src/api/api_profiling.cpp b/src/api/api_profiling.cpp
index 0abec66..994faff 100644
--- a/src/api/api_profiling.cpp
+++ b/src/api/api_profiling.cpp
@@ -35,12 +35,14 @@
// Profiling APIs
cl_int
-clGetEventProfilingInfo(cl_event event,
+clGetEventProfilingInfo(cl_event d_event,
cl_profiling_info param_name,
size_t param_value_size,
void * param_value,
size_t * param_value_size_ret)
{
+ auto event = pobj(d_event);
+
if (!event->isA(Coal::Object::T_Event))
return CL_INVALID_EVENT;
diff --git a/src/core/commandqueue.cpp b/src/core/commandqueue.cpp
index 22c55f2..7069a4a 100644
--- a/src/core/commandqueue.cpp
+++ b/src/core/commandqueue.cpp
@@ -262,7 +262,7 @@ void CommandQueue::releaseEvent(Event *e)
p_released_events.push_back(e);
pthread_mutex_unlock(&p_event_list_mutex);
#else
- clReleaseEvent((cl_event) e);
+ clReleaseEvent(desc(e));
#endif
}
@@ -307,7 +307,7 @@ void CommandQueue::cleanEvents()
#if ONLY_MAIN_THREAD_CAN_RELEASE_EVENT
p_released_events.push_back(event);
#else
- clReleaseEvent((cl_event) event);
+ clReleaseEvent(desc(event));
#endif
}
else if (is_inorder)
@@ -347,7 +347,7 @@ void CommandQueue::cleanReleasedEvents()
while (! p_released_events.empty())
{
Event *event = p_released_events.front();
- clReleaseEvent((cl_event)event);
+ clReleaseEvent(desc(event));
p_released_events.pop_front();
}
@@ -426,7 +426,7 @@ void CommandQueue::pushEventsOnDevice(Event *ready_event,
#if ONLY_MAIN_THREAD_CAN_RELEASE_EVENT
p_released_events.push_back(event);
#else
- clReleaseEvent((cl_event)event);
+ clReleaseEvent(desc(event));
#endif
continue;
}
@@ -498,7 +498,7 @@ void CommandQueue::pushEventsOnDevice(Event *ready_event,
pthread_cond_broadcast(&p_event_list_cond);
pthread_mutex_unlock(&p_event_list_mutex);
event->setStatus(CL_COMPLETE);
- clReleaseEvent((cl_event) event);
+ clReleaseEvent(desc(event));
return;
}
@@ -571,7 +571,7 @@ Event **CommandQueue::events(unsigned int &count,
Event::Event(CommandQueue *parent,
Status status,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: Object(Object::T_Event, parent),
p_status(status), p_device_data(0)
@@ -598,12 +598,13 @@ Event::Event(CommandQueue *parent,
// Check that none of the events in event_wait_list is in an error state
for (cl_uint i=0; i<num_events_in_wait_list; ++i)
{
- if (event_wait_list[i] == 0)
+ auto event = pobj(event_wait_list[i]);
+ if (event == 0)
{
*errcode_ret = CL_INVALID_EVENT_WAIT_LIST;
return;
}
- else if (event_wait_list[i]->status() < 0)
+ else if (event->status() < 0)
{
*errcode_ret = CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST;
return;
@@ -616,7 +617,7 @@ Event::Event(CommandQueue *parent,
for (cl_uint i=0; i<num_events_in_wait_list; ++i)
{
// if event_wait_list[i] is already COMPLETE, don't add it!!!
- Event *wait_event = (Event *) event_wait_list[i];
+ Event *wait_event = pobj(event_wait_list[i]);
if (wait_event->addDependentEvent((Event *) this))
p_wait_events.push_back(wait_event);
}
@@ -696,7 +697,7 @@ int Event::setStatusHelper(Status status)
for (std::list<CallbackData>::iterator C = callbacks.begin(),
E = callbacks.end(); C != E; ++C)
- (*C).callback((cl_event)this, p_status, (*C).user_data);
+ (*C).callback(desc(this), p_status, (*C).user_data);
return num_dependent_events;
}
@@ -899,7 +900,7 @@ void Event::setCallback(cl_int command_exec_callback_type,
pthread_mutex_unlock(&p_state_mutex);
if (call_now)
- data.callback((cl_event)this, p_status, data.user_data);
+ data.callback(desc(this), p_status, data.user_data);
}
/******************************************************************************
diff --git a/src/core/commandqueue.h b/src/core/commandqueue.h
index 8d90ef6..1f742cb 100644
--- a/src/core/commandqueue.h
+++ b/src/core/commandqueue.h
@@ -47,9 +47,10 @@
namespace Coal
{
class CommandQueue;
+ class Event;
}
struct _cl_command_queue: public Coal::descriptor<Coal::CommandQueue, _cl_command_queue> {};
-
+struct _cl_event : public Coal::descriptor<Coal::Event, _cl_event> {};
namespace Coal
{
@@ -236,7 +237,7 @@ class CommandQueue : public _cl_command_queue, public Object
* They only contain static and immutable data that is then used by the devices
* to actually implement the event.
*/
-class Event : public Object
+class Event : public _cl_event, public Object
{
public:
/**
@@ -323,7 +324,7 @@ class Event : public Object
Event(CommandQueue *parent,
Status status,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event * event_wait_list,
cl_int *errcode_ret);
void freeDeviceData(); /*!< \brief Call \c Coal::DeviceInterface::freeEventDeviceData() */
@@ -476,7 +477,4 @@ class Event : public Object
}
-struct _cl_event : public Coal::Event
-{};
-
#endif
diff --git a/src/core/dsp/worker.cpp b/src/core/dsp/worker.cpp
index 2d2ab5d..42953c1 100644
--- a/src/core/dsp/worker.cpp
+++ b/src/core/dsp/worker.cpp
@@ -417,7 +417,7 @@ bool handle_event_dispatch(DSPDevice *device)
-----------------------------------------------------------*/
if (e->buffer()->flags() & CL_MEM_USE_HOST_PTR) break;
- clRetainEvent((cl_event) e);
+ clRetainEvent(desc(e));
if(! e->buffer()->addMapEvent(e))
ERR(1, "MapBuffer: Range conflicts with previous maps");
if ((e->flags() & CL_MAP_READ) != 0)
diff --git a/src/core/events.cpp b/src/core/events.cpp
index 118cc34..22676f1 100644
--- a/src/core/events.cpp
+++ b/src/core/events.cpp
@@ -51,7 +51,7 @@ using namespace Coal;
BufferEvent::BufferEvent(CommandQueue *parent,
MemObject *buffer,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: Event(parent, CL_QUEUED, num_events_in_wait_list, event_wait_list, errcode_ret),
p_buffer(buffer)
@@ -141,7 +141,7 @@ ReadWriteBufferEvent::ReadWriteBufferEvent(CommandQueue *parent,
size_t cb,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: BufferEvent(parent, buffer, num_events_in_wait_list, event_wait_list, errcode_ret),
p_offset(offset), p_cb(cb), p_ptr(ptr)
@@ -183,7 +183,7 @@ ReadBufferEvent::ReadBufferEvent(CommandQueue *parent,
size_t cb,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: ReadWriteBufferEvent(parent, buffer, offset, cb, ptr, num_events_in_wait_list,
event_wait_list, errcode_ret)
@@ -200,7 +200,7 @@ WriteBufferEvent::WriteBufferEvent(CommandQueue *parent,
size_t cb,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: ReadWriteBufferEvent(parent, buffer, offset, cb, ptr, num_events_in_wait_list,
event_wait_list, errcode_ret)
@@ -217,7 +217,7 @@ MapBufferEvent::MapBufferEvent(CommandQueue *parent,
size_t cb,
cl_map_flags map_flags,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: BufferEvent(parent, buffer, num_events_in_wait_list, event_wait_list, errcode_ret),
p_offset(offset), p_cb(cb), p_map_flags(map_flags)
@@ -286,7 +286,7 @@ MapImageEvent::MapImageEvent(CommandQueue *parent,
const size_t origin[3],
const size_t region[3],
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: BufferEvent (parent, image, num_events_in_wait_list, event_wait_list, errcode_ret)
{
@@ -393,7 +393,7 @@ UnmapBufferEvent::UnmapBufferEvent(CommandQueue *parent,
MemObject *buffer,
void *mapped_addr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: BufferEvent(parent, buffer, num_events_in_wait_list, event_wait_list, errcode_ret),
p_mapping(mapped_addr)
@@ -425,7 +425,7 @@ CopyBufferEvent::CopyBufferEvent(CommandQueue *parent,
size_t dst_offset,
size_t cb,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: BufferEvent(parent, source, num_events_in_wait_list, event_wait_list,
errcode_ret), p_destination(destination), p_src_offset(src_offset),
@@ -523,7 +523,7 @@ FillBufferEvent::FillBufferEvent(CommandQueue *parent,
size_t offset,
size_t size,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: BufferEvent(parent, buffer, num_events_in_wait_list, event_wait_list, errcode_ret),
p_pattern(pattern), p_pattern_size(pattern_size), p_offset(offset), p_size(size)
@@ -590,7 +590,7 @@ NativeKernelEvent::NativeKernelEvent(CommandQueue *parent,
const MemObject **mem_list,
const void **args_mem_loc,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: Event (parent, CL_QUEUED, num_events_in_wait_list, event_wait_list, errcode_ret),
p_user_func((void *)user_func), p_args(0)
@@ -714,7 +714,7 @@ KernelEvent::KernelEvent(CommandQueue *parent,
const size_t *global_work_size,
const size_t *local_work_size,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: Event(parent, CL_QUEUED, num_events_in_wait_list, event_wait_list, errcode_ret),
p_work_dim(work_dim), p_kernel(kernel)
@@ -1001,7 +1001,7 @@ static size_t one = 1;
TaskEvent::TaskEvent(CommandQueue *parent,
Kernel *kernel,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: KernelEvent(parent, kernel, 1, 0, &one, &one, num_events_in_wait_list,
event_wait_list, errcode_ret)
@@ -1046,7 +1046,7 @@ ReadWriteCopyBufferRectEvent::ReadWriteCopyBufferRectEvent(CommandQueue *parent,
size_t dst_slice_pitch,
unsigned int bytes_per_element,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: BufferEvent (parent, source, num_events_in_wait_list, event_wait_list,
errcode_ret)
@@ -1186,7 +1186,7 @@ CopyBufferRectEvent::CopyBufferRectEvent(CommandQueue *parent,
size_t dst_slice_pitch,
unsigned int bytes_per_element,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: ReadWriteCopyBufferRectEvent(parent, source, src_origin, dst_origin, region,
src_row_pitch, src_slice_pitch, dst_row_pitch,
@@ -1283,7 +1283,7 @@ ReadWriteBufferRectEvent::ReadWriteBufferRectEvent(CommandQueue *parent,
void *ptr,
unsigned int bytes_per_element,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: ReadWriteCopyBufferRectEvent(parent, buffer, buffer_origin, host_origin, region,
buffer_row_pitch, buffer_slice_pitch,
@@ -1325,7 +1325,7 @@ ReadBufferRectEvent::ReadBufferRectEvent (CommandQueue *parent,
size_t host_slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: ReadWriteBufferRectEvent(parent, buffer, buffer_origin, host_origin, region,
buffer_row_pitch, buffer_slice_pitch, host_row_pitch,
@@ -1350,7 +1350,7 @@ WriteBufferRectEvent::WriteBufferRectEvent (CommandQueue *parent,
size_t host_slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: ReadWriteBufferRectEvent (parent, buffer, buffer_origin, host_origin, region,
buffer_row_pitch, buffer_slice_pitch, host_row_pitch,
@@ -1372,7 +1372,7 @@ ReadWriteImageEvent::ReadWriteImageEvent (CommandQueue *parent,
size_t slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: ReadWriteBufferRectEvent(parent, image, origin, 0, region, image->row_pitch(),
image->slice_pitch(), row_pitch, slice_pitch, ptr,
@@ -1397,7 +1397,7 @@ ReadImageEvent::ReadImageEvent(CommandQueue *parent,
size_t slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: ReadWriteImageEvent(parent, image, origin, region, row_pitch, slice_pitch, ptr,
num_events_in_wait_list, event_wait_list, errcode_ret)
@@ -1416,7 +1416,7 @@ WriteImageEvent::WriteImageEvent(CommandQueue *parent,
size_t slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: ReadWriteImageEvent (parent, image, origin, region, row_pitch, slice_pitch, ptr,
num_events_in_wait_list, event_wait_list, errcode_ret)
@@ -1440,7 +1440,7 @@ CopyImageEvent::CopyImageEvent(CommandQueue *parent,
const size_t dst_origin[3],
const size_t region[3],
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: CopyBufferRectEvent (parent, source, destination, src_origin, dst_origin,
region, source->row_pitch(), source->slice_pitch(),
@@ -1485,7 +1485,7 @@ CopyImageToBufferEvent::CopyImageToBufferEvent(CommandQueue *parent,
const size_t region[3],
size_t dst_offset,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: CopyBufferRectEvent(parent, source, destination, src_origin, 0, region,
source->row_pitch(), source->slice_pitch(), 0, 0,
@@ -1530,7 +1530,7 @@ CopyBufferToImageEvent::CopyBufferToImageEvent(CommandQueue *parent,
const size_t dst_origin[3],
const size_t region[3],
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: CopyBufferRectEvent(parent, source, destination, 0, dst_origin, region, 0, 0,
destination->row_pitch(), destination->slice_pitch(),
@@ -1574,7 +1574,7 @@ Event::Type CopyBufferToImageEvent::type() const
BarrierEvent::BarrierEvent(CommandQueue *parent,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: Event(parent, CL_QUEUED, num_events_in_wait_list, event_wait_list, errcode_ret)
{}
@@ -1590,7 +1590,7 @@ Event::Type BarrierEvent::type() const
WaitForEventsEvent::WaitForEventsEvent(CommandQueue *parent,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: Event(parent, CL_QUEUED, num_events_in_wait_list, event_wait_list, errcode_ret)
{}
@@ -1605,7 +1605,7 @@ Event::Type WaitForEventsEvent::type() const
*/
MarkerEvent::MarkerEvent(CommandQueue *parent,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: WaitForEventsEvent(parent, num_events_in_wait_list, event_wait_list, errcode_ret)
{}
@@ -1622,7 +1622,7 @@ MigrateMemObjectsEvent::MigrateMemObjectsEvent(CommandQueue *parent,
const Coal::MemObject **mem_objects,
cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret)
: Event(parent, CL_QUEUED, num_events_in_wait_list, event_wait_list, errcode_ret),
p_num_mem_objects(num_mem_objects), p_mem_objects(mem_objects), p_flags(flags)
diff --git a/src/core/events.h b/src/core/events.h
index ceb4fc1..00b6fb1 100644
--- a/src/core/events.h
+++ b/src/core/events.h
@@ -57,7 +57,7 @@ class BufferEvent : public Event
BufferEvent(CommandQueue *parent,
MemObject *buffer,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
virtual ~BufferEvent();
@@ -94,7 +94,7 @@ class ReadWriteBufferEvent : public BufferEvent
size_t cb,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
size_t offset() const; /*!< \brief Offset in the buffer of the operation, in bytes */
@@ -118,7 +118,7 @@ class ReadBufferEvent : public ReadWriteBufferEvent
size_t cb,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::ReadBuffer one */
@@ -136,7 +136,7 @@ class WriteBufferEvent : public ReadWriteBufferEvent
size_t cb,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::WriteBuffer one */
@@ -154,7 +154,7 @@ class MapBufferEvent : public BufferEvent
size_t cb,
cl_map_flags map_flags,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::MapBuffer one */
@@ -193,7 +193,7 @@ class MapImageEvent : public BufferEvent
const size_t origin[3],
const size_t region[3],
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::MapImage one */
@@ -248,7 +248,7 @@ class UnmapBufferEvent : public BufferEvent
MemObject *buffer,
void *mapped_addr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::UnmapBuffer one */
@@ -272,7 +272,7 @@ class CopyBufferEvent : public BufferEvent
size_t dst_offset,
size_t cb,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
~CopyBufferEvent();
@@ -302,7 +302,7 @@ class FillBufferEvent : public BufferEvent
size_t offset,
size_t size,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::FillBuffer one */
@@ -336,7 +336,7 @@ class ReadWriteCopyBufferRectEvent : public BufferEvent
size_t dst_slice_pitch,
unsigned int bytes_per_element,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
size_t src_origin(unsigned int index) const; /*!< \brief Source origin for the \p index dimension */
@@ -372,7 +372,7 @@ class CopyBufferRectEvent : public ReadWriteCopyBufferRectEvent
size_t dst_slice_pitch,
unsigned int bytes_per_element,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
virtual Type type() const; /*!< \brief Say the event is a \c Coal::Event::CopyBufferRect one */
@@ -400,7 +400,7 @@ class ReadWriteBufferRectEvent : public ReadWriteCopyBufferRectEvent
void *ptr,
unsigned int bytes_per_element,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
void *ptr() const; /*!< \brief Pointer in host memory in which to put the data */
@@ -426,7 +426,7 @@ class ReadBufferRectEvent : public ReadWriteBufferRectEvent
size_t host_slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::ReadBufferRect one */
@@ -449,7 +449,7 @@ class WriteBufferRectEvent : public ReadWriteBufferRectEvent
size_t host_slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::WriteBufferRect one */
@@ -473,7 +473,7 @@ class ReadWriteImageEvent : public ReadWriteBufferRectEvent
size_t slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
};
@@ -491,7 +491,7 @@ class ReadImageEvent : public ReadWriteImageEvent
size_t slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::ReadImage one */
@@ -511,7 +511,7 @@ class WriteImageEvent : public ReadWriteImageEvent
size_t slice_pitch,
void *ptr,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::WriteImage one */
@@ -530,7 +530,7 @@ class CopyImageEvent : public CopyBufferRectEvent
const size_t dst_origin[3],
const size_t region[3],
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::CopyImage one */
@@ -549,7 +549,7 @@ class CopyImageToBufferEvent : public CopyBufferRectEvent
const size_t region[3],
size_t dst_offset,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
size_t offset() const; /*!< \brief Offset in the buffer at which writing the image */
@@ -572,7 +572,7 @@ class CopyBufferToImageEvent : public CopyBufferRectEvent
const size_t dst_origin[3],
const size_t region[3],
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
size_t offset() const; /*!< \brief Offset in the buffer at which the copy starts */
@@ -601,7 +601,7 @@ class NativeKernelEvent : public Event
const MemObject **mem_list,
const void **args_mem_loc,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
~NativeKernelEvent();
@@ -628,7 +628,7 @@ class KernelEvent : public Event
const size_t *global_work_size,
const size_t *local_work_size,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
~KernelEvent();
@@ -669,7 +669,7 @@ class TaskEvent : public KernelEvent
TaskEvent(CommandQueue *parent,
Kernel *kernel,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::TaskKernel one */
@@ -709,7 +709,7 @@ class BarrierEvent : public Event
public:
BarrierEvent(CommandQueue *parent,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::Barrier one */
@@ -723,7 +723,7 @@ class WaitForEventsEvent : public Event
public:
WaitForEventsEvent(CommandQueue *parent,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
virtual Type type() const; /*!< \brief Say the event is a \c Coal::Event::WaitForEvents one */
@@ -737,7 +737,7 @@ class MarkerEvent : public WaitForEventsEvent
public:
MarkerEvent(CommandQueue *parent,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::Marker one */
@@ -751,7 +751,7 @@ class MigrateMemObjectsEvent: public Event
const Coal::MemObject **mem_objects,
cl_mem_migration_flags flags,
cl_uint num_events_in_wait_list,
- const Event **event_wait_list,
+ const cl_event *event_wait_list,
cl_int *errcode_ret);
Type type() const; /*!< \brief Say the event is a \c Coal::Event::MigrateMemObjects one */