internal Event(CLEvent openclEvent) { this.CLEvent = openclEvent; }
internal static extern CLError clEnqueueCopyImageToBuffer(CLCommandQueue command_queue, CLMem src_image, CLMem dst_buffer, SizeT[] src_origin, SizeT[] region, SizeT dst_offset, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern IntPtr clEnqueueMapImage(CLCommandQueue command_queue, CLMem image, CLBool blocking_map, CLMapFlags map_flags, SizeT[] origin, SizeT[] region, ref SizeT image_row_pitch, ref SizeT image_slice_pitch, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e, ref CLError errcode_ret);
internal static extern CLError clGetEventProfilingInfo(CLEvent e, CLProfilingInfo param_name, SizeT param_value_size, IntPtr param_value, ref SizeT param_value_size_ret);
internal static extern CLError clRetainEvent(CLEvent e);
internal static extern CLError clEnqueueTask(CLCommandQueue command_queue, CLKernel kernel, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern CLError clEnqueueWriteBuffer(CLCommandQueue command_queue, CLMem buffer, CLBool blocking_write, SizeT offset, SizeT cb, IntPtr ptr, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern IntPtr clEnqueueMapBuffer(CLCommandQueue command_queue, CLMem buffer, CLBool blocking_map, CLMapFlags map_flags, SizeT offset, SizeT cb, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e, ref CLError errcode_ret);
internal static extern CLError clEnqueueCopyBuffer(CLCommandQueue command_queue, CLMem src_buffer, CLMem dst_buffer, SizeT src_offset, SizeT dst_offset, SizeT cb, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern CLError clReleaseEvent(CLEvent e);
internal static extern CLError clEnqueueUnmapMemObject(CLCommandQueue command_queue, CLMem memobj, IntPtr mapped_ptr, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern CLError clEnqueueNDRangeKernel(CLCommandQueue command_queue, CLKernel kernel, int work_dim, [In] SizeT[] global_work_offset, [In] SizeT[] global_work_size, [In] SizeT[] local_work_size, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern CLError clEnqueueMarker(CLCommandQueue command_queue, ref CLEvent e);
internal static extern CLError clEnqueueNativeKernel(CLCommandQueue command_queue, UserFunction user_func, [In] IntPtr[] args, SizeT cb_args, int num_mem_objects, [In] CLMem[] mem_list, [In] IntPtr[] args_mem_loc, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern CLError clEnqueueWriteImage(CLCommandQueue command_queue, CLMem image, CLBool blocking_write, SizeT[] origin, SizeT[] region, SizeT input_row_pitch, SizeT input_slice_pitch, IntPtr ptr, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern CLError clEnqueueReadBuffer(CLCommandQueue command_queue, CLMem buffer, CLBool blocking_read, SizeT offset, SizeT cb, IntPtr ptr, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
internal static extern CLError clEnqueueReadImage(CLCommandQueue command_queue, CLMem image, CLBool blocking_read, SizeT[] origin, SizeT[] region, SizeT row_pitch, SizeT slice_pitch, IntPtr ptr, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);
private static Event WriteBytesInternal(CLMem openCLMem, CommandQueue commandQueue, Array array, Int64 bytesToCopy, Int64 arrayOffset, Int64 arraySize, Int64 bufferOffset, Int64 bufferSize, Events eventWaitList, WriteOperation writeDelegate) { if (bufferSize < bufferOffset + bytesToCopy) throw new ArgumentException(Resources.Buffer_out_of_bounds); if (arraySize < arrayOffset + bytesToCopy) throw new ArgumentException(Resources.Array_out_of_bounds); GCHandle valueHandle = GCHandle.Alloc(array, GCHandleType.Pinned); try { CLEvent e = new CLEvent(); unsafe { IntPtr valuePtr = new IntPtr((Byte*)(valueHandle.AddrOfPinnedObject().ToPointer()) + arrayOffset); OpenCLError.Validate ( writeDelegate ( commandQueue.CLCommandQueue, openCLMem, CLBool.True, new SizeT(bufferOffset), new SizeT(bytesToCopy), valuePtr, eventWaitList == null ? 0 : eventWaitList.Count, eventWaitList == null ? null : eventWaitList.OpenCLEventArray, ref e ) ); } return new Event(e); } finally { valueHandle.Free(); } }
public Event Acquire(CommandQueue commandQueue, Events eventWaitList) { CLEvent e = new CLEvent(); OpenCLError.Validate(OpenCLGLDriver.clEnqueueAcquireGLObjects(commandQueue.CLCommandQueue, memObjects.Length, memObjects, eventWaitList.Count, eventWaitList.OpenCLEventArray, ref e)); Acquired = true; return new Event(e); }
internal static extern CLError clEnqueueReleaseGLObjects(CLCommandQueue command_queue, int num_objects, [In] CLMem[] mem_objects, int num_events_in_wait_list, [In] CLEvent[] event_wait_list, ref CLEvent e);