IntPtr ICL10.EnqueueMapImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, bool blocking_map, ComputeMemoryMappingFlags map_flags, ref SysIntX3 origin, ref SysIntX3 region, out IntPtr image_row_pitch, out IntPtr image_slice_pitch, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event, out ComputeErrorCode errcode_ret) { return(EnqueueMapImage(command_queue, image, blocking_map, map_flags, ref origin, ref region, out image_row_pitch, out image_slice_pitch, num_events_in_wait_list, event_wait_list, new_event, out errcode_ret)); }
ComputeErrorCode ICL10.EnqueueWriteImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, bool blocking_write, ref SysIntX3 origin, ref SysIntX3 region, IntPtr input_row_pitch, IntPtr input_slice_pitch, IntPtr ptr, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event) { return(EnqueueWriteImage(command_queue, image, blocking_write, ref origin, ref region, input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, new_event)); }
ComputeErrorCode ICL10.EnqueueCopyBufferToImage(CLCommandQueueHandle command_queue, CLMemoryHandle src_buffer, CLMemoryHandle dst_image, IntPtr src_offset, ref SysIntX3 dst_origin, ref SysIntX3 region, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event) { return(EnqueueCopyBufferToImage(command_queue, src_buffer, dst_image, src_offset, ref dst_origin, ref region, num_events_in_wait_list, event_wait_list, new_event)); }
ComputeErrorCode ICL11.EnqueueCopyBufferRect(CLCommandQueueHandle command_queue, CLMemoryHandle src_buffer, CLMemoryHandle dst_buffer, ref SysIntX3 src_origin, ref SysIntX3 dst_origin, ref SysIntX3 region, IntPtr src_row_pitch, IntPtr src_slice_pitch, IntPtr dst_row_pitch, IntPtr dst_slice_pitch, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event) { return(EnqueueCopyBufferRect(command_queue, src_buffer, dst_buffer, ref src_origin, ref dst_origin, ref region, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events_in_wait_list, event_wait_list, new_event)); }
ComputeErrorCode ICL11.EnqueueWriteBufferRect(CLCommandQueueHandle command_queue, CLMemoryHandle buffer, bool blocking_write, ref SysIntX3 buffer_offset, ref SysIntX3 host_offset, ref SysIntX3 region, IntPtr buffer_row_pitch, IntPtr buffer_slice_pitch, IntPtr host_row_pitch, IntPtr host_slice_pitch, IntPtr ptr, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event) { return EnqueueWriteBufferRect(command_queue, buffer, blocking_write, ref buffer_offset, ref host_offset, ref region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, new_event); }
ComputeErrorCode ICL11.EnqueueCopyBufferRect(CLCommandQueueHandle command_queue, CLMemoryHandle src_buffer, CLMemoryHandle dst_buffer, ref SysIntX3 src_origin, ref SysIntX3 dst_origin, ref SysIntX3 region, IntPtr src_row_pitch, IntPtr src_slice_pitch, IntPtr dst_row_pitch, IntPtr dst_slice_pitch, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event) { return EnqueueCopyBufferRect(command_queue, src_buffer, dst_buffer, ref src_origin, ref dst_origin, ref region, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events_in_wait_list, event_wait_list, new_event); }
ComputeErrorCode ICL11.EnqueueWriteBufferRect(CLCommandQueueHandle command_queue, CLMemoryHandle buffer, bool blocking_write, ref SysIntX3 buffer_offset, ref SysIntX3 host_offset, ref SysIntX3 region, IntPtr buffer_row_pitch, IntPtr buffer_slice_pitch, IntPtr host_row_pitch, IntPtr host_slice_pitch, IntPtr ptr, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event) { return(EnqueueWriteBufferRect(command_queue, buffer, blocking_write, ref buffer_offset, ref host_offset, ref region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, new_event)); }
public extern static ComputeErrorCode EnqueueCopyBufferToImage( CLCommandQueueHandle command_queue, CLMemoryHandle src_buffer, CLMemoryHandle dst_image, IntPtr src_offset, ref SysIntX3 dst_origin, ref SysIntX3 region, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst = 1)] CLEventHandle[] new_event);
public extern static ComputeErrorCode EnqueueWriteImage( CLCommandQueueHandle command_queue, CLMemoryHandle image, [MarshalAs(UnmanagedType.Bool)] bool blocking_write, ref SysIntX3 origin, ref SysIntX3 region, IntPtr input_row_pitch, IntPtr input_slice_pitch, IntPtr ptr, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst = 1)] CLEventHandle[] new_event);
public extern static IntPtr EnqueueMapImage( CLCommandQueueHandle command_queue, CLMemoryHandle image, [MarshalAs(UnmanagedType.Bool)] bool blocking_map, ComputeMemoryMappingFlags map_flags, ref SysIntX3 origin, ref SysIntX3 region, out IntPtr image_row_pitch, out IntPtr image_slice_pitch, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst = 1)] CLEventHandle[] new_event, out ComputeErrorCode errcode_ret);
public extern static OpenCLErrorCode EnqueueCopyBufferRect( CLCommandQueueHandle command_queue, CLMemoryHandle src_buffer, CLMemoryHandle dst_buffer, ref SysIntX3 src_origin, ref SysIntX3 dst_origin, ref SysIntX3 region, IntPtr src_row_pitch, IntPtr src_slice_pitch, IntPtr dst_row_pitch, IntPtr dst_slice_pitch, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst = 1)] CLEventHandle[] new_event);
public static unsafe extern ComputeErrorCode EnqueueCopyBufferRect( IntPtr command_queue, IntPtr src_buffer, IntPtr dst_buffer, SysIntX3* src_origin, SysIntX3* dst_origin, SysIntX3* region, IntPtr src_row_pitch, IntPtr src_slice_pitch, IntPtr dst_row_pitch, IntPtr dst_slice_pitch, Int32 num_events_in_wait_list, IntPtr* event_wait_list, IntPtr* new_event);
public extern static ComputeErrorCode EnqueueReadBufferRect( CLCommandQueueHandle command_queue, CLMemoryHandle buffer, [MarshalAs(UnmanagedType.Bool)] bool blocking_read, ref SysIntX3 buffer_offset, ref SysIntX3 host_offset, ref SysIntX3 region, IntPtr buffer_row_pitch, IntPtr buffer_slice_pitch, IntPtr host_row_pitch, IntPtr host_slice_pitch, IntPtr ptr, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst = 1)] CLEventHandle[] new_event);
public static extern ComputeErrorCode EnqueueCopyImageToBuffer( CLCommandQueueHandle command_queue, CLMemoryHandle src_image, CLMemoryHandle dst_buffer, ref SysIntX3 src_origin, ref SysIntX3 region, IntPtr dst_offset, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst=1)] CLEventHandle[] new_event);
public ComputeErrorCode EnqueueWriteImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, [MarshalAs(UnmanagedType.Bool)] bool blocking_write, ref SysIntX3 origin, ref SysIntX3 region, IntPtr input_row_pitch, IntPtr input_slice_pitch, IntPtr ptr, int num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, CLEventHandle new_event) { throw new NotImplementedException(); }
public void Run(IComputeContext context, TextWriter log) { try { log.Write("Creating command queue... "); var commands = new ComputeCommandQueue(context, context.Devices[0], ComputeCommandQueueFlags.None); log.WriteLine("done."); log.Write("Generating data... "); int linearSize = 24; SysIntX2 rectSize = new SysIntX2(4, 6); SysIntX3 cubicSize = new SysIntX3(2, 3, 4); float[] linearIn = new float[linearSize]; float[] linearOut = new float[linearSize]; float[,] rectIn = new float[(int)rectSize.Y, (int)rectSize.X]; float[,] rectOut = new float[(int)rectSize.Y, (int)rectSize.X]; float[,,] cubicIn = new float[(int)cubicSize.Z, (int)cubicSize.Y, (int)cubicSize.X]; float[,,] cubicOut = new float[(int)cubicSize.Z, (int)cubicSize.Y, (int)cubicSize.X]; for (int i = 0; i < linearSize; i++) { linearIn[i] = i; } for (int i = 0; i < (int)rectSize.X; i++) { for (int j = 0; j < (int)rectSize.Y; j++) { rectIn[j, i] = (float)(rectSize.X.ToInt32() * j + i); } } for (int i = 0; i < (int)cubicSize.X; i++) { for (int j = 0; j < (int)cubicSize.Y; j++) { for (int k = 0; k < (int)cubicSize.Z; k++) { cubicIn[k, j, i] = (float)(k * cubicSize.Y.ToInt32() * cubicSize.X.ToInt32() + cubicSize.X.ToInt32() * j + i); } } } log.WriteLine("done."); log.Write("Creating buffer... "); var buffer = new ComputeBuffer <float>(context, ComputeMemoryFlags.ReadWrite, linearSize); log.WriteLine("done."); GC.Collect(); log.Write("Writing to buffer (linear)... "); commands.WriteToBuffer(linearIn, buffer, false, null); log.WriteLine("done."); log.Write("Reading from buffer (linear)... "); commands.ReadFromBuffer(buffer, ref linearOut, false, null); log.WriteLine("done."); GC.Collect(); commands.Finish(); log.Write("Comparing data... "); Compare(linearIn, linearOut); log.WriteLine("passed."); GC.Collect(); log.Write("Writing to buffer (rectangular)... "); commands.WriteToBuffer(rectIn, buffer, false, new SysIntX2(), new SysIntX2(), rectSize, null); log.WriteLine("done."); GC.Collect(); log.Write("Reading from buffer (rectangular)... "); commands.ReadFromBuffer(buffer, ref rectOut, false, new SysIntX2(), new SysIntX2(), rectSize, null); log.WriteLine("done."); GC.Collect(); commands.Finish(); log.Write("Comparing data... "); Compare(rectIn, rectOut); log.WriteLine("passed."); GC.Collect(); log.Write("Writing to buffer (cubic)... "); commands.WriteToBuffer(cubicIn, buffer, false, new SysIntX3(), new SysIntX3(), cubicSize, null); log.WriteLine("done."); GC.Collect(); log.Write("Reading from buffer (cubic)... "); commands.ReadFromBuffer(buffer, ref cubicOut, false, new SysIntX3(), new SysIntX3(), cubicSize, null); log.WriteLine("done."); GC.Collect(); commands.Finish(); log.Write("Comparing data... "); Compare(cubicIn, cubicOut); log.WriteLine("passed."); } catch (Exception e) { log.WriteLine(e.ToString()); } }
public static unsafe extern ComputeErrorCode EnqueueReadBufferRect( IntPtr command_queue, IntPtr buffer, ComputeBoolean blocking_read, SysIntX3* buffer_offset, SysIntX3* host_offset, SysIntX3* region, IntPtr buffer_row_pitch, IntPtr buffer_slice_pitch, IntPtr host_row_pitch, IntPtr host_slice_pitch, IntPtr ptr, Int32 num_events_in_wait_list, IntPtr* event_wait_list, IntPtr* new_event);
public ComputeErrorCode EnqueueWriteImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, [MarshalAs(UnmanagedType.Bool)] bool blocking_write, ref SysIntX3 origin, ref SysIntX3 region, IntPtr input_row_pitch, IntPtr input_slice_pitch, IntPtr ptr, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event) { return StaticEnqueueWriteImage(command_queue, image, blocking_write, ref origin, ref region, input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, out new_event); }
ComputeErrorCode ICL10.EnqueueCopyImageToBuffer(CLCommandQueueHandle command_queue, CLMemoryHandle src_image, CLMemoryHandle dst_buffer, ref SysIntX3 src_origin, ref SysIntX3 region, IntPtr dst_offset, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event) { return EnqueueCopyImageToBuffer(command_queue, src_image, dst_buffer, ref src_origin, ref region, dst_offset, num_events_in_wait_list, event_wait_list, new_event); }
public new ComputeErrorCode EnqueueCopyBufferRect(CLCommandQueueHandle command_queue, CLMemoryHandle src_buffer, CLMemoryHandle dst_buffer, ref SysIntX3 src_origin, ref SysIntX3 dst_origin, ref SysIntX3 region, IntPtr src_row_pitch, IntPtr src_slice_pitch, IntPtr dst_row_pitch, IntPtr dst_slice_pitch, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event) { return StaticEnqueueCopyBufferRect(command_queue, src_buffer, dst_buffer, ref src_origin, ref dst_origin, ref region, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events_in_wait_list, event_wait_list, out new_event); }
public ComputeErrorCode EnqueueCopyBufferRect(CLCommandQueueHandle command_queue, CLMemoryHandle src_buffer, CLMemoryHandle dst_buffer, ref SysIntX3 src_origin, ref SysIntX3 dst_origin, ref SysIntX3 region, IntPtr src_row_pitch, IntPtr src_slice_pitch, IntPtr dst_row_pitch, IntPtr dst_slice_pitch, int num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event) { throw new NotImplementedException(); }
public ComputeErrorCode EnqueueCopyImageToBuffer(CLCommandQueueHandle command_queue, CLMemoryHandle src_image, CLMemoryHandle dst_buffer, ref SysIntX3 src_origin, ref SysIntX3 region, IntPtr dst_offset, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event) { return StaticEnqueueCopyImageToBuffer(command_queue, src_image, dst_buffer, ref src_origin, ref region, dst_offset, num_events_in_wait_list, event_wait_list, out new_event); }
public static extern ComputeErrorCode StaticEnqueueCopyImage(CLCommandQueueHandle command_queue, CLMemoryHandle src_image, CLMemoryHandle dst_image, ref SysIntX3 src_origin, ref SysIntX3 dst_origin, ref SysIntX3 region, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event);
public static extern ComputeErrorCode StaticEnqueueReadImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, [MarshalAs(UnmanagedType.Bool)] bool blocking_read, ref SysIntX3 origin, ref SysIntX3 region, IntPtr row_pitch, IntPtr slice_pitch, IntPtr ptr, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event);
IntPtr ICL10.EnqueueMapImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, bool blocking_map, ComputeMemoryMappingFlags map_flags, ref SysIntX3 origin, ref SysIntX3 region, out IntPtr image_row_pitch, out IntPtr image_slice_pitch, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event, out ComputeErrorCode errcode_ret) { return EnqueueMapImage(command_queue, image, blocking_map, map_flags, ref origin, ref region, out image_row_pitch, out image_slice_pitch, num_events_in_wait_list, event_wait_list, new_event, out errcode_ret); }
public static extern ComputeErrorCode EnqueueWriteBufferRect( CLCommandQueueHandle command_queue, CLMemoryHandle buffer, [MarshalAs(UnmanagedType.Bool)] bool blocking_write, ref SysIntX3 buffer_offset, ref SysIntX3 host_offset, ref SysIntX3 region, IntPtr buffer_row_pitch, IntPtr buffer_slice_pitch, IntPtr host_row_pitch, IntPtr host_slice_pitch, IntPtr ptr, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst=1)] CLEventHandle[] new_event);
public extern static OpenCLErrorCode EnqueueCopyBufferRect( CLCommandQueueHandle command_queue, CLMemoryHandle src_buffer, CLMemoryHandle dst_buffer, ref SysIntX3 src_origin, ref SysIntX3 dst_origin, ref SysIntX3 region, IntPtr src_row_pitch, IntPtr src_slice_pitch, IntPtr dst_row_pitch, IntPtr dst_slice_pitch, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst=1)] CLEventHandle[] new_event);
public static extern IntPtr EnqueueMapImage( CLCommandQueueHandle command_queue, CLMemoryHandle image, [MarshalAs(UnmanagedType.Bool)] bool blocking_map, ComputeMemoryMappingFlags map_flags, ref SysIntX3 origin, ref SysIntX3 region, out IntPtr image_row_pitch, out IntPtr image_slice_pitch, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst = 1)] CLEventHandle[] new_event, out ComputeErrorCode errcode_ret);
public ComputeErrorCode EnqueueFillImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, IntPtr fill_color, ref SysIntX3 origin, ref SysIntX3 region, int num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event) { throw new NotImplementedException(); }
public static extern ComputeErrorCode EnqueueWriteImage( CLCommandQueueHandle command_queue, CLMemoryHandle image, [MarshalAs(UnmanagedType.Bool)] bool blocking_write, ref SysIntX3 origin, ref SysIntX3 region, IntPtr input_row_pitch, IntPtr input_slice_pitch, IntPtr ptr, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, [Out, MarshalAs(UnmanagedType.LPArray, SizeConst=1)] CLEventHandle[] new_event);
public IntPtr EnqueueMapImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, [MarshalAs(UnmanagedType.Bool)] bool blocking_map, ComputeMemoryMappingFlags map_flags, ref SysIntX3 origin, ref SysIntX3 region, out IntPtr image_row_pitch, out IntPtr image_slice_pitch, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event, out ComputeErrorCode errcode_ret) { return StaticEnqueueMapImage(command_queue, image, blocking_map, map_flags, ref origin, ref region, out image_row_pitch, out image_slice_pitch, num_events_in_wait_list, event_wait_list, out new_event, out errcode_ret); }
public new ComputeErrorCode EnqueueWriteBufferRect(CLCommandQueueHandle command_queue, CLMemoryHandle buffer, [MarshalAs(UnmanagedType.Bool)] bool blocking_write, ref SysIntX3 buffer_offset, ref SysIntX3 host_offset, ref SysIntX3 region, IntPtr buffer_row_pitch, IntPtr buffer_slice_pitch, IntPtr host_row_pitch, IntPtr host_slice_pitch, IntPtr ptr, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event) { return StaticEnqueueWriteBufferRect(command_queue, buffer, blocking_write, ref buffer_offset, ref host_offset, ref region, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, out new_event); }
public ComputeErrorCode EnqueueWriteBufferRect(CLCommandQueueHandle command_queue, CLMemoryHandle buffer, [MarshalAs(UnmanagedType.Bool)] bool blocking_write, ref SysIntX3 buffer_offset, ref SysIntX3 host_offset, ref SysIntX3 region, IntPtr buffer_row_pitch, IntPtr buffer_slice_pitch, IntPtr host_row_pitch, IntPtr host_slice_pitch, IntPtr ptr, int num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event) { throw new NotImplementedException(); }
public static extern ComputeErrorCode StaticEnqueueFillImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, IntPtr fill_color, ref SysIntX3 origin, ref SysIntX3 region, Int32 num_events_in_wait_list, [MarshalAs(UnmanagedType.LPArray)] CLEventHandle[] event_wait_list, out CLEventHandle new_event);
ComputeErrorCode ICL10.EnqueueWriteImage(CLCommandQueueHandle command_queue, CLMemoryHandle image, bool blocking_write, ref SysIntX3 origin, ref SysIntX3 region, IntPtr input_row_pitch, IntPtr input_slice_pitch, IntPtr ptr, int num_events_in_wait_list, CLEventHandle[] event_wait_list, CLEventHandle[] new_event) { return EnqueueWriteImage(command_queue, image, blocking_write, ref origin, ref region, input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, new_event); }