internal OpenCLEvent(CLEventHandle handle, OpenCLCommandQueue queue) { Handle = handle; SetID(Handle.Value); CommandQueue = queue; Type = (OpenCLCommandType)GetInfo<CLEventHandle, OpenCLEventInfo, int>(Handle, OpenCLEventInfo.CommandType, CL10.GetEventInfo); Context = queue.Context; if (OpenCLTools.ParseVersionString(CommandQueue.Device.Platform.Version, 1) > new Version(1, 0)) HookNotifier(); //Trace.WriteLine("Create " + this + " in Thread(" + Thread.CurrentThread.ManagedThreadId + ").", "Information"); }
public extern static OpenCLErrorCode SetEventCallback( CLEventHandle @event, Int32 command_exec_callback_type, OpenCLEventCallback pfn_notify, IntPtr user_data);
internal static CLEventHandle[] ExtractHandles(IReadOnlyList<OpenCLEventBase> computeObjects, out int handleCount) { if (computeObjects == null || computeObjects.Count == 0) { handleCount = 0; return null; } CLEventHandle[] result = new CLEventHandle[computeObjects.Count]; for (int i = 0; i < computeObjects.Count; i++) { result[i] = computeObjects[i].Handle; } handleCount = computeObjects.Count; return result; }
public extern static OpenCLErrorCode SetUserEventStatus( CLEventHandle @event, Int32 execution_status);
public extern static OpenCLErrorCode GetEventProfilingInfo( CLEventHandle @event, OpenCLCommandProfilingInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret);
public extern static OpenCLErrorCode EnqueueMarker( CLCommandQueueHandle command_queue, out CLEventHandle new_event);
public extern static OpenCLErrorCode ReleaseEvent( CLEventHandle @event);
private void StatusNotify(CLEventHandle eventHandle, int cmdExecStatusOrErr, IntPtr userData) { status = new OpenCLCommandStatusArgs(this, (OpenCLCommandExecutionStatus)cmdExecStatusOrErr); switch (cmdExecStatusOrErr) { case (int)OpenCLCommandExecutionStatus.Complete: OnCompleted(this, status); break; default: OnAborted(this, status); break; } }