Class OpenCLCompiler
Compiler for OpenCL which will be used to compile kernel created in C# and execute them.
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Amplifier
Assembly: Amplifier.dll
Syntax
public class OpenCLCompiler : BaseCompiler, IDisposable
Constructors
| Improve this Doc View SourceOpenCLCompiler()
Initializes a new instance of the OpenCLCompiler class.
Declaration
public OpenCLCompiler()
Properties
| Improve this Doc View SourceDevices
Gets or sets the devices.
Declaration
public override List<Device> Devices { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Device> | The devices. |
Overrides
| Improve this Doc View SourceKernels
Gets the kernel functions for the compiler.
Declaration
public override List<string> Kernels { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | The kernels. |
Overrides
Methods
| Improve this Doc View SourceCompileKernel(Type)
Compiles the kernel.
Declaration
public override void CompileKernel(Type cls)
Parameters
Type | Name | Description |
---|---|---|
System.Type | cls | The CLS. |
Overrides
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceExecute<TSource>(String, Object[])
Executes the specified kernel function name.
Declaration
public override void Execute<TSource>(string functionName, params object[] args)
where TSource : struct
Parameters
Type | Name | Description |
---|---|---|
System.String | functionName | Name of the function. |
System.Object[] | args |
Type Parameters
Name | Description |
---|---|
TSource | The type of the source. |
Overrides
Exceptions
Type | Condition |
---|---|
ExecutionException |
UseDevice(Int32)
Uses the device for the compiler.
Declaration
public override void UseDevice(int deviceId = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | deviceId | The device identifier. |
Overrides
Exceptions
Type | Condition |
---|---|
System.Exception | No device found. Please invoke Accelerator.Init with a device id to initialize. " + "If you have done the Init and still getting the error please check if OpenCL is installed. |
System.ArgumentException | Device ID out of range. |
Implements
System.IDisposable