Table of Contents

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

AcceleratorType

Methods

CanCompile(Expression)

Validates if an expression can be compiled to a kernel.

bool CanCompile(Expression expression)

Parameters

expression Expression

The 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

expression Expression

The expression to compile.

context KernelGenerationContext

The 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

operation string

The operation type.

inputTypes Type[]

The input data types.

outputType Type

The output data type.

context KernelGenerationContext

The kernel generation context.

Returns

GeneratedKernel

The generated kernel.

GetOptimizationHints(KernelGenerationContext)

Gets optimization hints for the kernel compiler.

KernelOptimizationHints GetOptimizationHints(KernelGenerationContext context)

Parameters

context KernelGenerationContext

The kernel generation context.

Returns

KernelOptimizationHints

Optimization hints.