/* Events APIs */
+typedef CL_API_ENTRY cl_int
+ (CL_API_CALL *MAGICKpfn_clGetEventInfo)(cl_event event,
+ cl_profiling_info param_name,size_t param_value_size,void *param_value,
+ size_t *param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
+
typedef CL_API_ENTRY cl_int
(CL_API_CALL *MAGICKpfn_clWaitForEvents)(cl_uint num_events,
const cl_event *event_list) CL_API_SUFFIX__VERSION_1_0;
MAGICKpfn_clEnqueueUnmapMemObject clEnqueueUnmapMemObject;
MAGICKpfn_clEnqueueNDRangeKernel clEnqueueNDRangeKernel;
+ MAGICKpfn_clGetEventInfo clGetEventInfo;
MAGICKpfn_clWaitForEvents clWaitForEvents;
MAGICKpfn_clReleaseEvent clReleaseEvent;
MAGICKpfn_clRetainEvent clRetainEvent;
BIND(clEnqueueUnmapMemObject);
BIND(clEnqueueNDRangeKernel);
+ BIND(clGetEventInfo);
BIND(clWaitForEvents);
BIND(clReleaseEvent);
BIND(clRetainEvent);
return((MagickCLCacheInfo) NULL);
if (relinquish_pixels != MagickFalse)
{
- if (info->event_count > 0)
+ MagickBooleanType
+ events_completed;
+
+ ssize_t
+ i;
+
+ events_completed=MagickTrue;
+ for (i=0; i < (ssize_t)info->event_count; i++)
+ {
+ cl_int
+ event_status;
+
+ cl_uint
+ status;
+
+ status=openCL_library->clGetEventInfo(info->events[i],
+ CL_EVENT_COMMAND_EXECUTION_STATUS,sizeof(cl_int),&event_status,NULL);
+ if ((status == CL_SUCCESS) && (event_status != CL_COMPLETE))
+ {
+ events_completed=MagickFalse;
+ break;
+ }
+ }
+ if (events_completed == MagickFalse)
openCL_library->clSetEventCallback(info->events[info->event_count-1],
CL_COMPLETE,&DestroyMagickCLCacheInfoAndPixels,info);
else