Table of Contents

Class KernelCompilationOptions

Namespace
DotCompute.Abstractions.Kernels
Assembly
DotCompute.Abstractions.dll

Configuration options for kernel compilation

public sealed class KernelCompilationOptions
Inheritance
KernelCompilationOptions
Inherited Members

Constructors

KernelCompilationOptions()

Creates a new instance of KernelCompilationOptions with default values

public KernelCompilationOptions()

Properties

CacheTimeout

Gets or sets the cache timeout in seconds

public TimeSpan CacheTimeout { get; set; }

Property Value

TimeSpan

CompilerFlags

Gets or sets additional compiler flags

public IList<string> CompilerFlags { get; }

Property Value

IList<string>

Definitions

Gets or sets preprocessor definitions

public Dictionary<string, string> Definitions { get; }

Property Value

Dictionary<string, string>

EnableAutoVectorization

Gets or sets whether to enable auto-vectorization

public bool EnableAutoVectorization { get; set; }

Property Value

bool

EnableCaching

Gets or sets whether to enable kernel caching

public bool EnableCaching { get; set; }

Property Value

bool

EnableFastMath

Gets or sets whether to enable fast math optimizations

public bool EnableFastMath { get; set; }

Property Value

bool

EnableLoopUnrolling

Gets or sets whether to enable loop unrolling

public bool EnableLoopUnrolling { get; set; }

Property Value

bool

FloatingPointMode

Gets or sets the floating point mode

public FloatingPointMode FloatingPointMode { get; set; }

Property Value

FloatingPointMode

GenerateDebugInfo

Gets or sets whether to generate debug information

public bool GenerateDebugInfo { get; set; }

Property Value

bool

GenerateLineInfo

Gets or sets whether to enable line-info generation

public bool GenerateLineInfo { get; set; }

Property Value

bool

GenerateRelocatableCode

Gets or sets whether to generate relocatable device code

public bool GenerateRelocatableCode { get; set; }

Property Value

bool

IncludeDirectories

Gets or sets include directories for compilation

public IList<string> IncludeDirectories { get; }

Property Value

IList<string>

MaxRegisterCount

Gets or sets the maximum register count per thread

public int? MaxRegisterCount { get; set; }

Property Value

int?

OptimizationHints

Gets or sets custom optimization hints

public OptimizationHint OptimizationHints { get; set; }

Property Value

OptimizationHint

OptimizationLevel

Gets or sets the optimization level for compilation

public OptimizationLevel OptimizationLevel { get; set; }

Property Value

OptimizationLevel

PreferredCacheConfig

Gets or sets the preferred cache configuration

public CacheConfig PreferredCacheConfig { get; set; }

Property Value

CacheConfig

TargetArchitecture

Gets or sets the target architecture for compilation

public string? TargetArchitecture { get; set; }

Property Value

string

UsePtx

Gets or sets whether to use PTX intermediate representation (CUDA only)

public bool UsePtx { get; set; }

Property Value

bool

VerboseOutput

Gets or sets whether to enable verbose compilation output

public bool VerboseOutput { get; set; }

Property Value

bool

WarningLevel

Gets or sets the warning level (0-4)

public int WarningLevel { get; set; }

Property Value

int

WarningsAsErrors

Gets or sets whether to treat warnings as errors

public bool WarningsAsErrors { get; set; }

Property Value

bool

Methods

AddDefinition(string, string)

Adds a preprocessor definition

public void AddDefinition(string name, string value = "")

Parameters

name string

The definition name

value string

The definition value (optional)

AddFlag(string)

Adds a compiler flag

public void AddFlag(string flag)

Parameters

flag string

The compiler flag to add

AddIncludeDirectory(string)

Adds an include directory

public void AddIncludeDirectory(string directory)

Parameters

directory string

The include directory path

Balanced()

Creates compilation options balanced between performance and compile time

public static KernelCompilationOptions Balanced()

Returns

KernelCompilationOptions

A new KernelCompilationOptions instance with balanced settings

Clone()

Creates a copy of the current KernelCompilationOptions

public KernelCompilationOptions Clone()

Returns

KernelCompilationOptions

A new KernelCompilationOptions instance with the same values

Debug()

Creates compilation options optimized for debug builds

public static KernelCompilationOptions Debug()

Returns

KernelCompilationOptions

A new KernelCompilationOptions instance configured for debugging

Release()

Creates compilation options optimized for release builds

public static KernelCompilationOptions Release()

Returns

KernelCompilationOptions

A new KernelCompilationOptions instance configured for release