ILGPU  0.9.0
ILGPU.Runtime.OpenCL.CLKernel Class Reference

Represents an OpenCL kernel that can be directly launched on an OpenCL device. More...

Inheritance diagram for ILGPU.Runtime.OpenCL.CLKernel:
ILGPU.Runtime.Kernel ILGPU.Runtime.AcceleratorObject ILGPU.Util.DisposeBase ILGPU.Runtime.IAcceleratorObject

Public Member Functions

 CLKernel (CLAccelerator accelerator, CLCompiledKernel kernel, MethodInfo launcher)
 Loads a compiled kernel into the given OpenCL context as kernel program. More...
 
byte[] LoadBinaryRepresentation ()
 Loads the binary representation of the underlying OpenCL kernel. More...
 
- Public Member Functions inherited from ILGPU.Runtime.Kernel
TDelegate CreateLauncherDelegate< TDelegate > ()
 Creates a launcher delegate for this kernel. More...
 
void Launch< TIndex > (AcceleratorStream stream, TIndex dimension, params object[] args)
 Launches the current kernel with the given arguments. More...
 
void Launch (AcceleratorStream stream, int dimension, params object[] args)
 Launches the current kernel with the given arguments. More...
 
- Public Member Functions inherited from ILGPU.Util.DisposeBase
void Dispose ()
 Triggers the 'dispose' functionality of this object. More...
 

Static Public Member Functions

static CLError LoadKernel (CLAccelerator accelerator, string source, CLCVersion version, out IntPtr programPtr, out IntPtr kernelPtr, out string errorLog)
 Loads the given OpenCL kernel. More...
 
static unsafe byte[] LoadBinaryRepresentation (IntPtr program)
 Loads the binary representation of the given OpenCL kernel. More...
 
- Static Public Member Functions inherited from ILGPU.Runtime.Kernel
static TDelegate CreateSpecializedLauncher< TDelegate, TLoader > (Accelerator accelerator, in EntryPointDescription entry, in KernelSpecialization specialization, Method kernelMethod, in TLoader loader)
 Creates a launcher delegate that uses the SpecializationCache<TLoader, TArgs, TDelegate> to create dynamically specialized kernels. More...
 

Public Attributes

IntPtr ProgramPtr => programPtr
 Returns the OpenCL program ptr. More...
 
IntPtr KernelPtr => kernelPtr
 Returns the OpenCL kernel ptr. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from ILGPU.Runtime.Kernel
 Kernel (Accelerator accelerator, CompiledKernel compiledKernel, MethodInfo launcher)
 Constructs a new kernel. More...
 
- Protected Member Functions inherited from ILGPU.Runtime.AcceleratorObject
 AcceleratorObject ()
 Constructs an accelerator object that lives on the CPU. More...
 
 AcceleratorObject (Accelerator accelerator)
 Constructs an accelerator object. More...
 

Additional Inherited Members

- Properties inherited from ILGPU.Runtime.Kernel
MethodInfo Launcher [get, set]
 Returns the associated kernel launcher. More...
 
KernelSpecialization Specialization [get]
 Returns the associated specialization. More...
 
int NumParameters [get]
 Returns the number of uniform parameters. More...
 
- Properties inherited from ILGPU.Runtime.AcceleratorObject
Accelerator Accelerator [get]
 Returns the associated accelerator. More...
 
AcceleratorType AcceleratorType [get]
 Returns the accelerator type of this object. More...
 
- Properties inherited from ILGPU.Runtime.IAcceleratorObject
Accelerator Accelerator [get]
 Returns the associated accelerator. More...
 
AcceleratorType AcceleratorType [get]
 Returns the accelerator type of this object. More...
 

Detailed Description

Represents an OpenCL kernel that can be directly launched on an OpenCL device.

Constructor & Destructor Documentation

ILGPU.Runtime.OpenCL.CLKernel.CLKernel ( CLAccelerator  accelerator,
CLCompiledKernel  kernel,
MethodInfo  launcher 
)

Loads a compiled kernel into the given OpenCL context as kernel program.

Parameters
acceleratorThe associated accelerator.
kernelThe source kernel.
launcherThe launcher method for the given kernel.

Member Function Documentation

override void ILGPU.Runtime.OpenCL.CLKernel.Dispose ( bool  disposing)
protectedvirtual

Reimplemented from ILGPU.Util.DisposeBase.

static unsafe byte [] ILGPU.Runtime.OpenCL.CLKernel.LoadBinaryRepresentation ( IntPtr  program)
static

Loads the binary representation of the given OpenCL kernel.

Parameters
programThe program pointer.
Returns
The binary representation of the underlying kernel.
byte [] ILGPU.Runtime.OpenCL.CLKernel.LoadBinaryRepresentation ( )

Loads the binary representation of the underlying OpenCL kernel.

Returns
The binary representation of the underlying kernel.
static CLError ILGPU.Runtime.OpenCL.CLKernel.LoadKernel ( CLAccelerator  accelerator,
string  source,
CLCVersion  version,
out IntPtr  programPtr,
out IntPtr  kernelPtr,
out string  errorLog 
)
static

Loads the given OpenCL kernel.

Parameters
acceleratorThe associated accelerator.
sourceThe OpenCL source code.
versionThe OpenCL C version.
programPtrThe created program pointer.
kernelPtrThe created kernel pointer.
errorLogThe error log (if any).
Returns
True, if the program and the kernel could be loaded successfully.

Member Data Documentation

IntPtr ILGPU.Runtime.OpenCL.CLKernel.KernelPtr => kernelPtr

Returns the OpenCL kernel ptr.

IntPtr ILGPU.Runtime.OpenCL.CLKernel.ProgramPtr => programPtr

Returns the OpenCL program ptr.


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