Cloo 0.9.1
|
Represents an OpenCL program. More...
Public Member Functions | |
ComputeProgram (ComputeContext context, string source) | |
Creates a new ComputeProgram from a source code string. | |
ComputeProgram (ComputeContext context, string[] source) | |
Creates a new ComputeProgram from an array of source code strings. | |
ComputeProgram (ComputeContext context, IList< byte[]> binaries, IList< ComputeDevice > devices) | |
Creates a new ComputeProgram from a specified list of binaries. | |
void | Build (ICollection< ComputeDevice > devices, string options, ComputeProgramBuildNotifier notify, IntPtr notifyDataPtr) |
Builds (compiles and links) a program executable from the program source or binary for all or some of the ComputeProgram.Devices. | |
ICollection< ComputeKernel > | CreateAllKernels () |
Creates a ComputeKernel for every kernel function in ComputeProgram. | |
ComputeKernel | CreateKernel (string functionName) |
Creates a ComputeKernel for a kernel function of a specified name. | |
string | GetBuildLog (ComputeDevice device) |
Gets the build log of the ComputeProgram for a specified ComputeDevice. | |
ComputeProgramBuildStatus | GetBuildStatus (ComputeDevice device) |
Gets the ComputeProgramBuildStatus of the ComputeProgram for a specified ComputeDevice. | |
Protected Member Functions | |
override void | Dispose (bool manual) |
Releases the associated OpenCL object. | |
Properties | |
CLProgramHandle | Handle [get, set] |
The handle of the ComputeProgram. | |
ReadOnlyCollection< byte[]> | Binaries [get] |
Gets a read-only collection of program binaries associated with the ComputeProgram.Devices. | |
string | BuildOptions [get] |
Gets the ComputeProgram build options as specified in options argument of ComputeProgram.Build. | |
ComputeContext | Context [get] |
Gets the ComputeContext of the ComputeProgram. | |
ReadOnlyCollection< ComputeDevice > | Devices [get] |
Gets a read-only collection of ComputeDevices associated with the ComputeProgram. | |
ReadOnlyCollection< string > | Source [get] |
Gets a read-only collection of program source code strings specified when creating the ComputeProgram or null if ComputeProgram was created using program binaries. |
Represents an OpenCL program.
An OpenCL program consists of a set of kernels. Programs may also contain auxiliary functions called by the kernel functions and constant data.
Cloo.ComputeProgram.ComputeProgram | ( | ComputeContext | context, |
string | source | ||
) |
Creates a new ComputeProgram from a source code string.
context | A ComputeContext. |
source | The source code for the ComputeProgram. |
The created ComputeProgram is associated with the ComputeContext.Devices.
Cloo.ComputeProgram.ComputeProgram | ( | ComputeContext | context, |
string[] | source | ||
) |
Creates a new ComputeProgram from an array of source code strings.
context | A ComputeContext. |
source | The source code lines for the ComputeProgram. |
The created ComputeProgram is associated with the ComputeContext.Devices.
Cloo.ComputeProgram.ComputeProgram | ( | ComputeContext | context, |
IList< byte[]> | binaries, | ||
IList< ComputeDevice > | devices | ||
) |
Creates a new ComputeProgram from a specified list of binaries.
context | A ComputeContext. |
binaries | A list of binaries, one for each item in devices . |
devices | A subset of the ComputeContext.Devices. If devices is null , OpenCL will associate every binary from ComputeProgram.Binaries with a corresponding ComputeDevice from ComputeContext.Devices. |
void Cloo.ComputeProgram.Build | ( | ICollection< ComputeDevice > | devices, |
string | options, | ||
ComputeProgramBuildNotifier | notify, | ||
IntPtr | notifyDataPtr | ||
) |
Builds (compiles and links) a program executable from the program source or binary for all or some of the ComputeProgram.Devices.
devices | A subset or all of ComputeProgram.Devices. If devices is null , the executable is built for every item of ComputeProgram.Devices for which a source or a binary has been loaded. |
options | A set of options for the OpenCL compiler. |
notify | A delegate instance that represents a reference to a notification routine. This routine is a callback function that an application can register and which will be called when the program executable has been built (successfully or unsuccessfully). If notify is not null , ComputeProgram.Build does not need to wait for the build to complete and can return immediately. If notify is null , ComputeProgram.Build does not return until the build has completed. The callback function may be called asynchronously by the OpenCL implementation. It is the application's responsibility to ensure that the callback function is thread-safe and that the delegate instance doesn't get collected by the Garbage Collector until the build operation triggers the callback. |
notifyDataPtr | Optional user data that will be passed to notify . |
ICollection<ComputeKernel> Cloo.ComputeProgram.CreateAllKernels | ( | ) |
Creates a ComputeKernel for every kernel
function in ComputeProgram.
ComputeKernels are not created for any kernel
functions in ComputeProgram that do not have the same function definition across all ComputeProgram.Devices for which a program executable has been successfully built.
ComputeKernel Cloo.ComputeProgram.CreateKernel | ( | string | functionName | ) |
Creates a ComputeKernel for a kernel function of a specified name.
override void Cloo.ComputeProgram.Dispose | ( | bool | manual | ) | [protected, virtual] |
Releases the associated OpenCL object.
manual | Specifies the operation mode of this method. |
manual must be true
if this method is invoked directly by the application.
Implements Cloo.ComputeResource.
string Cloo.ComputeProgram.GetBuildLog | ( | ComputeDevice | device | ) |
Gets the build log of the ComputeProgram for a specified ComputeDevice.
device | The ComputeDevice building the ComputeProgram. Must be one of ComputeProgram.Devices. |
ComputeProgramBuildStatus Cloo.ComputeProgram.GetBuildStatus | ( | ComputeDevice | device | ) |
Gets the ComputeProgramBuildStatus of the ComputeProgram for a specified ComputeDevice.
device | The ComputeDevice building the ComputeProgram. Must be one of ComputeProgram.Devices. |
ReadOnlyCollection<byte[]> Cloo.ComputeProgram.Binaries [get] |
Gets a read-only collection of program binaries associated with the ComputeProgram.Devices.
A read-only collection of program binaries associated with the ComputeProgram.Devices.
The bits returned can be an implementation-specific intermediate representation (a.k.a. IR) or device specific executable bits or both. The decision on which information is returned in the binary is up to the OpenCL implementation.
string Cloo.ComputeProgram.BuildOptions [get] |
Gets the ComputeProgram build options as specified in options argument of ComputeProgram.Build.
The ComputeProgram build options as specified in options argument of ComputeProgram.Build.
ComputeContext Cloo.ComputeProgram.Context [get] |
Gets the ComputeContext of the ComputeProgram.
The ComputeContext of the ComputeProgram.
ReadOnlyCollection<ComputeDevice> Cloo.ComputeProgram.Devices [get] |
Gets a read-only collection of ComputeDevices associated with the ComputeProgram.
A read-only collection of ComputeDevices associated with the ComputeProgram.
This collection is a subset of ComputeProgram.Context.Devices.
CLProgramHandle Cloo.ComputeProgram.Handle [get, set] |
The handle of the ComputeProgram.
ReadOnlyCollection<string> Cloo.ComputeProgram.Source [get] |
Gets a read-only collection of program source code strings specified when creating the ComputeProgram or null
if ComputeProgram was created using program binaries.
A read-only collection of program source code strings specified when creating the ComputeProgram or null
if ComputeProgram was created using program binaries.