Cloo 0.9.1

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Properties
Cloo.ComputeKernel Class Reference

Represents an OpenCL kernel. More...

Inheritance diagram for Cloo.ComputeKernel:

List of all members.

## Public Member Functions
long | GetLocalMemorySize (ComputeDevice device)
| Gets the amount of local memory in bytes used by the ComputeKernel.
long[] | GetCompileWorkGroupSize (ComputeDevice device)
| Gets the compile work-group size specified by the `__attribute__((reqd_work_group_size(X, Y, Z)))` qualifier.
long | GetPreferredWorkGroupSizeMultiple (ComputeDevice device)
| Gets the preferred multiple of workgroup size for launch.
long | GetPrivateMemorySize (ComputeDevice device)
| Gets the minimum amount of memory, in bytes, used by each work-item in the kernel.
long | GetWorkGroupSize (ComputeDevice device)
| Gets the maximum work-group size that can be used to execute the ComputeKernel on a ComputeDevice.
void | SetArgument (int index, IntPtr dataSize, IntPtr dataAddr)
| Sets an argument of the ComputeKernel (no argument tracking).
void | SetLocalArgument (int index, long dataSize)
| Sets the size in bytes of an argument specfied with the `local` or `__local` address space qualifier.
void | SetMemoryArgument (int index, ComputeMemory memObj)
| Sets a `T*`, `image2d_t` or `image3d_t` argument of the ComputeKernel.
void | SetSamplerArgument (int index, ComputeSampler sampler)
| Sets a `sampler_t` argument of the ComputeKernel.
void | SetValueArgument< T > (int index, T data)
| Sets a value argument of the ComputeKernel.
## Protected Member Functions
override void | Dispose (bool manual)
| Releases the associated OpenCL object.
## Properties
CLKernelHandle | Handle`[get, set]`
| The handle of the ComputeKernel.
ComputeContext | Context`[get]`
| Gets the ComputeContext associated with the ComputeKernel.
string | FunctionName`[get]`
| Gets the function name of the ComputeKernel.
ComputeProgram | Program`[get]`
| Gets the ComputeProgram that the ComputeKernel belongs to.

## Detailed Description

Represents an OpenCL kernel.

A kernel object encapsulates a specific kernel function declared in a program and the argument values to be used when executing this kernel function.

See also:
  ComputeCommandQueue, ComputeProgram

## Member Function Documentation

override void Cloo.ComputeKernel.Dispose | ( | bool | manual | ) | `[protected, virtual]`

Releases the associated OpenCL object.

Parameters:

  manual | Specifies the operation mode of this method.

manual must be `true` if this method is invoked directly by the application.

Implements Cloo.ComputeResource.

long [] Cloo.ComputeKernel.GetCompileWorkGroupSize | ( | ComputeDevice | device | ) |

Gets the compile work-group size specified by the `__attribute__((reqd_work_group_size(X, Y, Z)))` qualifier.

Parameters:

  device | One of the ComputeKernel.Program.Devices.

Returns:
  The compile work-group size specified by the `__attribute__((reqd_work_group_size(X, Y, Z)))` qualifier. If no such qualifier is specified, (0, 0, 0) is returned.

long Cloo.ComputeKernel.GetLocalMemorySize | ( | ComputeDevice | device | ) |

Gets the amount of local memory in bytes used by the ComputeKernel.

Parameters:

  device | One of the ComputeKernel.Program.Devices.

Returns:
  The amount of local memory in bytes used by the ComputeKernel.

long Cloo.ComputeKernel.GetPreferredWorkGroupSizeMultiple | ( | ComputeDevice | device | ) |

Gets the preferred multiple of workgroup size for launch.

Parameters:

  device | One of the ComputeKernel.Program.Devices.

Returns:
  The preferred multiple of workgroup size for launch.

The returned value is a performance hint. Specifying a workgroup size that is not a multiple of the value returned by this query as the value of the local work size argument to ComputeCommandQueue.Execute will not fail to enqueue the kernel for execution unless the work-group size specified is larger than the device maximum. Requires OpenCL 1.1.

long Cloo.ComputeKernel.GetPrivateMemorySize | ( | ComputeDevice | device | ) |

Gets the minimum amount of memory, in bytes, used by each work-item in the kernel.

Parameters:

  device | One of the ComputeKernel.Program.Devices.

Returns:
  The minimum amount of memory, in bytes, used by each work-item in the kernel.

The returned value may include any private memory needed by an implementation to execute the kernel, including that used by the language built-ins and variable declared inside the kernel with the `__private` or `private` qualifier.

long Cloo.ComputeKernel.GetWorkGroupSize | ( | ComputeDevice | device | ) |

Gets the maximum work-group size that can be used to execute the ComputeKernel on a ComputeDevice.

Parameters:

  device | One of the ComputeKernel.Program.Devices.

Returns:
  The maximum work-group size that can be used to execute the ComputeKernel on device .

void Cloo.ComputeKernel.SetArgument | ( | int | index,
|  | IntPtr | dataSize,
|  | IntPtr | dataAddr
| ) |  |

Sets an argument of the ComputeKernel (no argument tracking).

Parameters:

  index | The argument index.
  dataSize | The size of the argument data in bytes.
  dataAddr | A pointer to the data that should be used as the argument value.

Arguments to the kernel are referred by indices that go from 0 for the leftmost argument to n-1, where n is the total number of arguments declared by the kernel.
Note that this method does not provide argument tracking. It is up to the user to reference the kernel arguments (i.e. prevent them from being garbage collected) until the kernel has finished execution.

void Cloo.ComputeKernel.SetLocalArgument | ( | int | index,
|  | long | dataSize
| ) |  |

Sets the size in bytes of an argument specfied with the `local` or `__local` address space qualifier.

Parameters:

  index | The argument index.
  dataSize | The size of the argument data in bytes.

Arguments to the kernel are referred by indices that go from 0 for the leftmost argument to n-1, where n is the total number of arguments declared by the kernel.

void Cloo.ComputeKernel.SetMemoryArgument | ( | int | index,
|  | ComputeMemory | memObj
| ) |  |

Sets a `T*`, `image2d_t` or `image3d_t` argument of the ComputeKernel.

Parameters:

  index | The argument index.
  memObj | The ComputeMemory that is passed as the argument.

This method will automatically track memObj to prevent it from being collected by the GC.
Arguments to the kernel are referred by indices that go from 0 for the leftmost argument to n-1, where n is the total number of arguments declared by the kernel.

void Cloo.ComputeKernel.SetSamplerArgument | ( | int | index,
|  | ComputeSampler | sampler
| ) |  |

Sets a `sampler_t` argument of the ComputeKernel.

Parameters:

  index | The argument index.
  sampler | The ComputeSampler that is passed as the argument.

This method will automatically track sampler to prevent it from being collected by the GC.
Arguments to the kernel are referred by indices that go from 0 for the leftmost argument to n-1, where n is the total number of arguments declared by the kernel.

void Cloo.ComputeKernel.SetValueArgument< T > | ( | int | index,
|  | T | data
| ) |  |

Sets a value argument of the ComputeKernel.

Template Parameters:

  T | The type of the argument.

Parameters:

  index | The argument index.
  data | The data that is passed as the argument value.

Arguments to the kernel are referred by indices that go from 0 for the leftmost argument to n-1, where n is the total number of arguments declared by the kernel.

Type Constraints

  T | : | struct |

## Property Documentation

ComputeContext Cloo.ComputeKernel.Context`[get]`

Gets the ComputeContext associated with the ComputeKernel.

The ComputeContext associated with the ComputeKernel.

string Cloo.ComputeKernel.FunctionName`[get]`

Gets the function name of the ComputeKernel.

The function name of the ComputeKernel.

CLKernelHandle Cloo.ComputeKernel.Handle`[get, set]`

The handle of the ComputeKernel.

ComputeProgram Cloo.ComputeKernel.Program`[get]`

Gets the ComputeProgram that the ComputeKernel belongs to.

The ComputeProgram that the ComputeKernel belongs to.

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

- Cloo/Source/ComputeKernel.cs