Public Member Functions | Protected Member Functions | Properties

Cloo.ComputeProgram Class Reference

Represents an OpenCL program. More...

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

List of all members.

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< ComputeKernelCreateAllKernels ()
 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< ComputeDeviceDevices [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.

Detailed Description

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.

See also:
ComputeKernel

Constructor & Destructor Documentation

Cloo.ComputeProgram.ComputeProgram ( ComputeContext  context,
string  source 
)

Creates a new ComputeProgram from a source code string.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Member Function Documentation

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.

Parameters:
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.

Returns:
The collection of created ComputeKernels.

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.

Returns:
The created 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.

Parameters:
device The ComputeDevice building the ComputeProgram. Must be one of ComputeProgram.Devices.
Returns:
The build log of the ComputeProgram for device .
ComputeProgramBuildStatus Cloo.ComputeProgram.GetBuildStatus ( ComputeDevice  device  ) 

Gets the ComputeProgramBuildStatus of the ComputeProgram for a specified ComputeDevice.

Parameters:
device The ComputeDevice building the ComputeProgram. Must be one of ComputeProgram.Devices.
Returns:
The ComputeProgramBuildStatus of the ComputeProgram for device .
override string Cloo.ComputeProgram.ToString (  ) 

Gets the string representation of the ComputeProgram.

Returns:
The string representation of the ComputeProgram.

Reimplemented from Cloo.ComputeObject.


Property Documentation

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 ComputeDevices associated with the ComputeProgram.

This collection contains ComputeDevices 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.


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