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 . | |
override string | ToString () |
Gets the string representation of the ComputeProgram . | |
Protected Member Functions | |
override void | Dispose (bool manual) |
Properties | |
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 ComputeDevice s 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 the ComputeProgram.Devices . If devices is null , the executable is built for every item of the ComputeProgram.Devices for which a source or a binary has been loaded. | |
options | A set of options for the OpenCL compiler. | |
notify | A notification routine. The notification 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. This 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. | |
notifyDataPtr | Optional user data that will be passed to notify . |
ICollection<ComputeKernel> Cloo.ComputeProgram.CreateAllKernels | ( | ) |
Creates a ComputeKernel
for every kernel
function in ComputeProgram
.
ComputeKernel
s. ComputeKernel
s 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.
ComputeKernel
. override void Cloo.ComputeProgram.Dispose | ( | bool | manual | ) | [protected, virtual] |
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 . |
ComputeProgram
for device . 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 . |
ComputeProgramBuildStatus
of the ComputeProgram
for device . override string Cloo.ComputeProgram.ToString | ( | ) |
Gets the string representation of the ComputeProgram
.
ComputeProgram
. Reimplemented from Cloo.ComputeObject.
ReadOnlyCollection<byte[]> Cloo.ComputeProgram.Binaries [get] |
Gets 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
.
ComputeContext Cloo.ComputeProgram.Context [get] |
Gets the ComputeContext
of the ComputeProgram
.
ReadOnlyCollection<ComputeDevice> Cloo.ComputeProgram.Devices [get] |
Gets a read-only collection of ComputeDevice
s associated with the ComputeProgram
.
This collection contains ComputeDevice
s from ComputeProgram.Context.Devices
.
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.