ILGPU  0.9.0
ILGPU.Runtime.Kernel Class Reference

Represents the base class for all runtime kernels. More...

Inheritance diagram for ILGPU.Runtime.Kernel:
ILGPU.Runtime.AcceleratorObject ILGPU.Util.DisposeBase ILGPU.Runtime.IAcceleratorObject ILGPU.Runtime.CPU.CPUKernel ILGPU.Runtime.Cuda.CudaKernel ILGPU.Runtime.OpenCL.CLKernel

Public Member Functions

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

Protected Member Functions

 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...
 
- Protected Member Functions inherited from ILGPU.Util.DisposeBase
virtual void Dispose (bool disposing)
 Frees allocated resources. More...
 

Properties

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 the base class for all runtime kernels.

Members of this class are not thread safe.

Constructor & Destructor Documentation

ILGPU.Runtime.Kernel.Kernel ( Accelerator  accelerator,
CompiledKernel  compiledKernel,
MethodInfo  launcher 
)
protected

Constructs a new kernel.

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

Member Function Documentation

TDelegate ILGPU.Runtime.Kernel.CreateLauncherDelegate< TDelegate > ( )

Creates a launcher delegate for this kernel.

Template Parameters
TDelegateThe delegate type.
Returns
The created delegate.

Note that the first argument is the accelerator stream.

Type Constraints
TDelegate :Delegate 
TDelegate :Launcher.CreateDelegate 
TDelegate :typeof 
TDelegate :TDelegate 
TDelegate :this 
TDelegate :as 
TDelegate :object 
TDelegate :as 
TDelegate :TDelegate 
static TDelegate ILGPU.Runtime.Kernel.CreateSpecializedLauncher< TDelegate, TLoader > ( Accelerator  accelerator,
in EntryPointDescription  entry,
in KernelSpecialization  specialization,
Method  kernelMethod,
in TLoader  loader 
)
static

Creates a launcher delegate that uses the SpecializationCache<TLoader, TArgs, TDelegate> to create dynamically specialized kernels.

Template Parameters
TLoaderThe associated loader type.
TDelegateThe launcher delegate type.
Parameters
acceleratorThe associated accelerator.
entryThe entry point to compile into a kernel.
specializationThe kernel specialization.
kernelMethodThe kernel IR method.
loaderThe loader instance.
Returns
A dynamic kernel launcher that automatically specializes kernels.
Type Constraints
TDelegate :Delegate 
TLoader :struct 
TLoader :Accelerator.IKernelLoader 
void ILGPU.Runtime.Kernel.Launch ( AcceleratorStream  stream,
int  dimension,
params object[]  args 
)

Launches the current kernel with the given arguments.

Parameters
dimensionThe grid dimension.
streamThe accelerator stream.
argsThe kernel arguments.
void ILGPU.Runtime.Kernel.Launch< TIndex > ( AcceleratorStream  stream,
TIndex  dimension,
params object[]  args 
)

Launches the current kernel with the given arguments.

Template Parameters
TIndexThe index type.
Parameters
streamThe accelerator stream.
dimensionThe grid dimension.
argsThe kernel arguments.
Type Constraints
TIndex :struct 
TIndex :IIndex 
TIndex :InvokeLauncher 
TIndex :dimension 
TIndex :stream 
TIndex :args 

Property Documentation

MethodInfo ILGPU.Runtime.Kernel.Launcher
getset

Returns the associated kernel launcher.

int ILGPU.Runtime.Kernel.NumParameters
get

Returns the number of uniform parameters.

KernelSpecialization ILGPU.Runtime.Kernel.Specialization
get

Returns the associated specialization.


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