Interface IKernelGenerator
- Namespace
- DotCompute.Abstractions.Interfaces.Kernels
- Assembly
- DotCompute.Abstractions.dll
Interface for generating GPU kernels from expressions or operations.
public interface IKernelGenerator
Properties
AcceleratorType
Gets the supported accelerator type for this generator.
AcceleratorType AcceleratorType { get; }
Property Value
Methods
CanCompile(Expression)
Validates if an expression can be compiled to a kernel.
bool CanCompile(Expression expression)
Parameters
expressionExpressionThe expression to validate.
Returns
- bool
True if the expression can be compiled, false otherwise.
GenerateKernel(Expression, KernelGenerationContext)
Generates kernel source code from an expression.
GeneratedKernel GenerateKernel(Expression expression, KernelGenerationContext context)
Parameters
expressionExpressionThe expression to compile.
contextKernelGenerationContextThe kernel generation context.
Returns
- GeneratedKernel
The generated kernel.
GenerateOperationKernel(string, Type[], Type, KernelGenerationContext)
Generates kernel source code for a specific operation.
GeneratedKernel GenerateOperationKernel(string operation, Type[] inputTypes, Type outputType, KernelGenerationContext context)
Parameters
operationstringThe operation type.
inputTypesType[]The input data types.
outputTypeTypeThe output data type.
contextKernelGenerationContextThe kernel generation context.
Returns
- GeneratedKernel
The generated kernel.
GetOptimizationHints(KernelGenerationContext)
Gets optimization hints for the kernel compiler.
KernelOptimizationHints GetOptimizationHints(KernelGenerationContext context)
Parameters
contextKernelGenerationContextThe kernel generation context.
Returns
- KernelOptimizationHints
Optimization hints.