Public Member Functions | Protected Member Functions | Properties

Cloo.ComputeCommandQueue Class Reference

Represents an OpenCL command queue. More...

Inheritance diagram for Cloo.ComputeCommandQueue:
Cloo.ComputeResource Cloo.ComputeObject

List of all members.

Public Member Functions

 ComputeCommandQueue (ComputeContext context, ComputeDevice device, ComputeCommandQueueFlags properties)
 Creates a new ComputeCommandQueue.
void AcquireGLObjects (ICollection< ComputeMemory > memObjs, ICollection< ComputeEvent > events)
 Enqueues a command to acquire a collection of ComputeMemorys that have been previously created from OpenGL objects.
void AddBarrier ()
 Enqueues a barrier.
ComputeEvent AddMarker ()
 Enqueues a marker.
void Copy< T > (ComputeBuffer< T > source, ComputeBuffer< T > destination, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Copy< T > (ComputeBuffer< T > source, ComputeBuffer< T > destination, long sourceOffset, long destinationOffset, long count, ICollection< ComputeEvent > events)
 Enqueues a command to copy data between ComputeBuffers.
void Copy< T > (ComputeBuffer< T > source, ComputeImage destination, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Copy< T > (ComputeBuffer< T > source, ComputeImage destination, long sourceOffset, long[] destinationOffset, long[] region, ICollection< ComputeEvent > events)
 Enqueues a command to copy data from ComputeBuffer to ComputeImage.
void Copy< T > (ComputeImage source, ComputeBuffer< T > destination, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Copy< T > (ComputeImage source, ComputeBuffer< T > destination, long[] sourceOffset, long destinationOffset, long[] region, ICollection< ComputeEvent > events)
 Enqueues a command to copy data from ComputeImage to ComputeBuffer.
void Copy (ComputeImage source, ComputeImage destination, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Copy (ComputeImage source, ComputeImage destination, long[] sourceOffset, long[] destinationOffset, long[] region, ICollection< ComputeEvent > events)
 Enqueues a command to copy data between ComputeImages.
void ExecuteTask (ComputeKernel kernel, ICollection< ComputeEvent > events)
 Enqueues a command to execute a single ComputeKernel.
void Execute (ComputeKernel kernel, long[] globalWorkOffset, long[] globalWorkSize, long[] localWorkSize, ICollection< ComputeEvent > events)
 Enqueues a command to parallely execute a range of ComputeKernels.
void Finish ()
 Blocks until all previously queued OpenCL commands in the ComputeCommandQueue are issued to the ComputeCommandQueue.Device and have completed.
void Flush ()
 Issues all previously queued OpenCL commands in the ComputeCommandQueue to the ComputeCommandQueue.Device.
IntPtr Map< T > (ComputeBuffer< T > buffer, bool blocking, ComputeMemoryMappingFlags flags, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
IntPtr Map< T > (ComputeBuffer< T > buffer, bool blocking, ComputeMemoryMappingFlags flags, long offset, long count, ICollection< ComputeEvent > events)
 Enqueues a command to map a part of a ComputeBuffer into the host address space.
IntPtr Map (ComputeImage image, bool blocking, ComputeMemoryMappingFlags flags, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
IntPtr Map (ComputeImage image, bool blocking, ComputeMemoryMappingFlags flags, long[] offset, long[] region, ICollection< ComputeEvent > events)
 Enqueues a command to map a part of a ComputeImage into the host address space.
T[] Read< T > (ComputeBuffer< T > buffer, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
T[] Read< T > (ComputeBuffer< T > buffer, long offset, long count, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Read< T > (ComputeBuffer< T > buffer, bool blocking, long offset, long count, IntPtr data, ICollection< ComputeEvent > events)
 Enqueues a command to read data from a ComputeBuffer.
void Read (ComputeImage image, bool blocking, IntPtr data, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Read (ComputeImage image, bool blocking, long[] offset, long[] region, IntPtr data, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Read (ComputeImage image, bool blocking, long[] offset, long[] region, long rowPitch, long slicePitch, IntPtr data, ICollection< ComputeEvent > events)
 Enqueues a command to read data from a ComputeImage.
void ReleaseGLObjects (ICollection< ComputeMemory > memObjs, ICollection< ComputeEvent > events)
 Enqueues a command to release ComputeMemorys that have been created from OpenGL objects.
override string ToString ()
 Gets the string representation of the ComputeCommandQueue.
void Unmap (ComputeMemory memory, ref IntPtr mappedPtr, ICollection< ComputeEvent > events)
 Enqueues a command to unmap a ComputeBuffer or a ComputeImage from the host address space.
void Wait (ICollection< ComputeEvent > events)
 Enqueues a wait command for a collection of ComputeEvents to complete before any future commands queued in the ComputeCommandQueue are executed.
void Write< T > (ComputeBuffer< T > buffer, T[] data, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Write< T > (ComputeBuffer< T > buffer, long offset, long count, T[] data, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Write< T > (ComputeBuffer< T > buffer, bool blocking, long offset, long count, IntPtr data, ICollection< ComputeEvent > events)
 Enqueues a command to write data to a ComputeBuffer.
void Write (ComputeImage image, bool blocking, IntPtr data, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Write (ComputeImage image, bool blocking, long[] offset, long[] region, IntPtr data, ICollection< ComputeEvent > events)
 Deprecated. Use the full version instead.
void Write (ComputeImage image, bool blocking, long[] offset, long[] region, long rowPitch, long slicePitch, IntPtr data, ICollection< ComputeEvent > events)
 Enqueues a command to write data to a ComputeImage.

Protected Member Functions

override void Dispose (bool manual)

Properties

ComputeContext Context [get]
 Gets the ComputeContext of the ComputeCommandQueue.
ComputeDevice Device [get]
 Gets the ComputeDevice of the ComputeCommandQueue.
bool OutOfOrderExecution [get, set]
 Gets or sets the out-of-order execution mode of the commands in the ComputeCommandQueue.
bool Profiling [get, set]
 Gets or sets the profiling mode of the commands in the ComputeCommandQueue.

Detailed Description

Represents an OpenCL command queue.

An object that holds commands that will be executed on a specific device. The command-queue is created on a specific device in a context. Commands to a command-queue are queued in-order but may be executed in-order or out-of-order.

See also:
ComputeContext, ComputeDevice

Constructor & Destructor Documentation

Cloo.ComputeCommandQueue.ComputeCommandQueue ( ComputeContext  context,
ComputeDevice  device,
ComputeCommandQueueFlags  properties 
)

Creates a new ComputeCommandQueue.

Parameters:
context A ComputeContext.
device A ComputeDevice associated with the context . It can either be one of ComputeContext.Devices or have the same ComputeDeviceTypes as the device specified when the context is created.
properties The properties for the ComputeCommandQueue.

Member Function Documentation

void Cloo.ComputeCommandQueue.AcquireGLObjects ( ICollection< ComputeMemory memObjs,
ICollection< ComputeEvent events 
)

Enqueues a command to acquire a collection of ComputeMemorys that have been previously created from OpenGL objects.

Parameters:
memObjs A collection of ComputeMemorys that correspond to OpenGL memory objects.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.
void Cloo.ComputeCommandQueue.AddBarrier (  ) 

Enqueues a barrier.

A barrier ensures that all queued commands have finished execution before the next batch of commands can begin execution.

ComputeEvent Cloo.ComputeCommandQueue.AddMarker (  ) 

Enqueues a marker.

void Cloo.ComputeCommandQueue.Copy ( ComputeImage  source,
ComputeImage  destination,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

void Cloo.ComputeCommandQueue.Copy ( ComputeImage  source,
ComputeImage  destination,
long[]  sourceOffset,
long[]  destinationOffset,
long[]  region,
ICollection< ComputeEvent events 
)

Enqueues a command to copy data between ComputeImages.

Parameters:
source The ComputeImage to copy from.
destination The ComputeImage to copy to.
sourceOffset The source (x, y, z) offset in pixels where reading starts.
destinationOffset The destination (x, y, z) offset in pixels where writing starts.
region The region (width, height, depth) in pixels to copy.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.
void Cloo.ComputeCommandQueue.Copy< T > ( ComputeBuffer< T >  source,
ComputeBuffer< T >  destination,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.Copy< T > ( ComputeImage  source,
ComputeBuffer< T >  destination,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.Copy< T > ( ComputeImage  source,
ComputeBuffer< T >  destination,
long[]  sourceOffset,
long  destinationOffset,
long[]  region,
ICollection< ComputeEvent events 
)

Enqueues a command to copy data from ComputeImage to ComputeBuffer.

Parameters:
source The ComputeImage to copy from.
destination The ComputeBuffer to copy to.
sourceOffset The source (x, y, z) offset in pixels where reading starts.
destinationOffset The destination offset in elements where writing starts.
region The region (width, height, depth) in pixels to copy.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.
Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.Copy< T > ( ComputeBuffer< T >  source,
ComputeBuffer< T >  destination,
long  sourceOffset,
long  destinationOffset,
long  count,
ICollection< ComputeEvent events 
)

Enqueues a command to copy data between ComputeBuffers.

Parameters:
source The ComputeBuffer to copy from.
destination The ComputeBuffer to copy to.
sourceOffset The source offset in elements where reading starts.
destinationOffset The destination offset in elements where writing starts.
count The number of elements to copy.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.
Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.Copy< T > ( ComputeBuffer< T >  source,
ComputeImage  destination,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.Copy< T > ( ComputeBuffer< T >  source,
ComputeImage  destination,
long  sourceOffset,
long[]  destinationOffset,
long[]  region,
ICollection< ComputeEvent events 
)

Enqueues a command to copy data from ComputeBuffer to ComputeImage.

Parameters:
source The ComputeBuffer to copy from.
destination The ComputeImage to copy to.
sourceOffset The source offset in elements where reading starts.
destinationOffset The destination (x, y, z) offset in pixels where writing starts.
region The region (width, height, depth) in pixels to copy.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.
Type Constraints
T :struct 
override void Cloo.ComputeCommandQueue.Dispose ( bool  manual  )  [protected, virtual]

Implements Cloo.ComputeResource.

void Cloo.ComputeCommandQueue.Execute ( ComputeKernel  kernel,
long[]  globalWorkOffset,
long[]  globalWorkSize,
long[]  localWorkSize,
ICollection< ComputeEvent events 
)

Enqueues a command to parallely execute a range of ComputeKernels.

Parameters:
kernel The ComputeKernel to execute.
globalWorkOffset An array of values that describe the offset used to calculate the global ID of a work-item instead of having the global IDs always start at offset (0, 0,... 0).
globalWorkSize An array of values that describe the number of global work-items in dimensions that will execute the kernel function. The total number of global work-items is computed as global_work_size[0] *...* global_work_size[work_dim - 1].
localWorkSize An array of values that describe the number of work-items that make up a work-group (also referred to as the size of the work-group) that will execute the kernel . The total number of work-items in a work-group is computed as local_work_size[0] *... * local_work_size[work_dim - 1].
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.
void Cloo.ComputeCommandQueue.ExecuteTask ( ComputeKernel  kernel,
ICollection< ComputeEvent events 
)

Enqueues a command to execute a single ComputeKernel.

Parameters:
kernel The ComputeKernel to execute.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.
void Cloo.ComputeCommandQueue.Finish (  ) 

Blocks until all previously queued OpenCL commands in the ComputeCommandQueue are issued to the ComputeCommandQueue.Device and have completed.

void Cloo.ComputeCommandQueue.Flush (  ) 

Issues all previously queued OpenCL commands in the ComputeCommandQueue to the ComputeCommandQueue.Device.

This method only guarantees that all queued commands get issued to the OpenCL device. There is no guarantee that they will be complete after this method returns.

IntPtr Cloo.ComputeCommandQueue.Map ( ComputeImage  image,
bool  blocking,
ComputeMemoryMappingFlags  flags,
long[]  offset,
long[]  region,
ICollection< ComputeEvent events 
)

Enqueues a command to map a part of a ComputeImage into the host address space.

Parameters:
image The ComputeImage to map.
blocking The mode of operation of this call.
flags A list of properties for the mapping mode.
offset The source (x, y, z) offset in pixels where mapping starts.
region The region (width, height, depth) in pixels to map.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.

If blocking is true this method will not return until the command completes. If blocking is false this method will return immediately after enqueueing the command in the ComputeCommandQueue.

IntPtr Cloo.ComputeCommandQueue.Map ( ComputeImage  image,
bool  blocking,
ComputeMemoryMappingFlags  flags,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

IntPtr Cloo.ComputeCommandQueue.Map< T > ( ComputeBuffer< T >  buffer,
bool  blocking,
ComputeMemoryMappingFlags  flags,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

Type Constraints
T :struct 
IntPtr Cloo.ComputeCommandQueue.Map< T > ( ComputeBuffer< T >  buffer,
bool  blocking,
ComputeMemoryMappingFlags  flags,
long  offset,
long  count,
ICollection< ComputeEvent events 
)

Enqueues a command to map a part of a ComputeBuffer into the host address space.

Parameters:
buffer The ComputeBuffer to map.
blocking The mode of operation of this call.
flags A list of properties for the mapping mode.
offset The source offset in elements where mapping starts.
count The number of elements to map.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.

If blocking is true this method will not return until the command completes. If blocking is false this method will return immediately after enqueueing the command in the ComputeCommandQueue.

Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.Read ( ComputeImage  image,
bool  blocking,
IntPtr  data,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

void Cloo.ComputeCommandQueue.Read ( ComputeImage  image,
bool  blocking,
long[]  offset,
long[]  region,
long  rowPitch,
long  slicePitch,
IntPtr  data,
ICollection< ComputeEvent events 
)

Enqueues a command to read data from a ComputeImage.

Parameters:
image The ComputeImage to read from.
blocking The mode of operation of this call.
offset The (x, y, z) offset in pixels where reading starts.
region The region (width, height, depth) in pixels to read.
rowPitch The ComputeImage.RowPitch or 0.
slicePitch The ComputeImage.SlicePitch or 0.
data A preallocated memory area to read the data into.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.

If blocking is true this method will not return until the command completes. If blocking is false this method will return immediately after enqueueing the command in the ComputeCommandQueue.

void Cloo.ComputeCommandQueue.Read ( ComputeImage  image,
bool  blocking,
long[]  offset,
long[]  region,
IntPtr  data,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

T [] Cloo.ComputeCommandQueue.Read< T > ( ComputeBuffer< T >  buffer,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

Type Constraints
T :struct 
T [] Cloo.ComputeCommandQueue.Read< T > ( ComputeBuffer< T >  buffer,
long  offset,
long  count,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.Read< T > ( ComputeBuffer< T >  buffer,
bool  blocking,
long  offset,
long  count,
IntPtr  data,
ICollection< ComputeEvent events 
)

Enqueues a command to read data from a ComputeBuffer.

Parameters:
buffer The buffer to read from.
blocking The mode of operation of this call.
offset The offset in elements where reading starts.
count The number of elements to read.
data A preallocated memory area to read the data into.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.

If blocking is true this method will not return until the command completes. If blocking is false this method will return immediately after enqueueing the command in the ComputeCommandQueue.

Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.ReleaseGLObjects ( ICollection< ComputeMemory memObjs,
ICollection< ComputeEvent events 
)

Enqueues a command to release ComputeMemorys that have been created from OpenGL objects.

Parameters:
memObjs A collection of ComputeMemorys that correspond to OpenGL memory objects.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.
override string Cloo.ComputeCommandQueue.ToString (  ) 

Gets the string representation of the ComputeCommandQueue.

Returns:
The string representation of the ComputeCommandQueue.

Reimplemented from Cloo.ComputeObject.

void Cloo.ComputeCommandQueue.Unmap ( ComputeMemory  memory,
ref IntPtr  mappedPtr,
ICollection< ComputeEvent events 
)

Enqueues a command to unmap a ComputeBuffer or a ComputeImage from the host address space.

Parameters:
memory The ComputeMemory.
mappedPtr The host address returned by a previous call to ComputeCommandQueue.Map.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.
void Cloo.ComputeCommandQueue.Wait ( ICollection< ComputeEvent events  ) 

Enqueues a wait command for a collection of ComputeEvents to complete before any future commands queued in the ComputeCommandQueue are executed.

Parameters:
events The ComputeEvents that this command will wait for.
void Cloo.ComputeCommandQueue.Write ( ComputeImage  image,
bool  blocking,
long[]  offset,
long[]  region,
IntPtr  data,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

void Cloo.ComputeCommandQueue.Write ( ComputeImage  image,
bool  blocking,
long[]  offset,
long[]  region,
long  rowPitch,
long  slicePitch,
IntPtr  data,
ICollection< ComputeEvent events 
)

Enqueues a command to write data to a ComputeImage.

Parameters:
image The ComputeImage to write to.
blocking The mode of operation of this call.
offset The (x, y, z) offset in pixels where writing starts.
region The region (width, height, depth) in pixels to write.
rowPitch The ComputeImage.RowPitch or 0.
slicePitch The ComputeImage.SlicePitch or 0.
data The content written to the ComputeImage.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.

If blocking is true this method will not return until the command completes. If blocking is false this method will return immediately after enqueueing the command in the ComputeCommandQueue.

void Cloo.ComputeCommandQueue.Write ( ComputeImage  image,
bool  blocking,
IntPtr  data,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

void Cloo.ComputeCommandQueue.Write< T > ( ComputeBuffer< T >  buffer,
long  offset,
long  count,
T[]  data,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.Write< T > ( ComputeBuffer< T >  buffer,
T[]  data,
ICollection< ComputeEvent events 
)

Deprecated. Use the full version instead.

Type Constraints
T :struct 
void Cloo.ComputeCommandQueue.Write< T > ( ComputeBuffer< T >  buffer,
bool  blocking,
long  offset,
long  count,
IntPtr  data,
ICollection< ComputeEvent events 
)

Enqueues a command to write data to a ComputeBuffer.

Parameters:
buffer The buffer to write to.
blocking The mode of operation of this call.
offset The offset in elements where writing starts.
count The number of elements to write.
data The content written to the ComputeBuffer.
events A collection of ComputeEvents that need to complete before this particular command can be executed. If events is not null a new ComputeEvent identifying this command is attached to the end of the collection.

If blocking is true this method will not return until the command completes. If blocking is false this method will return immediately after enqueueing the command in the ComputeCommandQueue.

Type Constraints
T :struct 

Property Documentation

ComputeContext Cloo.ComputeCommandQueue.Context [get]
ComputeDevice Cloo.ComputeCommandQueue.Device [get]
bool Cloo.ComputeCommandQueue.OutOfOrderExecution [get, set]

Gets or sets the out-of-order execution mode of the commands in the ComputeCommandQueue.

bool Cloo.ComputeCommandQueue.Profiling [get, set]

Gets or sets the profiling mode of the commands in the ComputeCommandQueue.


The documentation for this class was generated from the following file: