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
CompilerFlags
Gets or sets additional compiler flags
public IList<string> CompilerFlags { get; }
Property Value
Definitions
Gets or sets preprocessor definitions
public Dictionary<string, string> Definitions { get; }
Property Value
EnableAutoVectorization
Gets or sets whether to enable auto-vectorization
public bool EnableAutoVectorization { get; set; }
Property Value
EnableCaching
Gets or sets whether to enable kernel caching
public bool EnableCaching { get; set; }
Property Value
EnableFastMath
Gets or sets whether to enable fast math optimizations
public bool EnableFastMath { get; set; }
Property Value
EnableLoopUnrolling
Gets or sets whether to enable loop unrolling
public bool EnableLoopUnrolling { get; set; }
Property Value
FloatingPointMode
Gets or sets the floating point mode
public FloatingPointMode FloatingPointMode { get; set; }
Property Value
GenerateDebugInfo
Gets or sets whether to generate debug information
public bool GenerateDebugInfo { get; set; }
Property Value
GenerateLineInfo
Gets or sets whether to enable line-info generation
public bool GenerateLineInfo { get; set; }
Property Value
GenerateRelocatableCode
Gets or sets whether to generate relocatable device code
public bool GenerateRelocatableCode { get; set; }
Property Value
IncludeDirectories
Gets or sets include directories for compilation
public IList<string> IncludeDirectories { get; }
Property Value
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
OptimizationLevel
Gets or sets the optimization level for compilation
public OptimizationLevel OptimizationLevel { get; set; }
Property Value
PreferredCacheConfig
Gets or sets the preferred cache configuration
public CacheConfig PreferredCacheConfig { get; set; }
Property Value
TargetArchitecture
Gets or sets the target architecture for compilation
public string? TargetArchitecture { get; set; }
Property Value
UsePtx
Gets or sets whether to use PTX intermediate representation (CUDA only)
public bool UsePtx { get; set; }
Property Value
VerboseOutput
Gets or sets whether to enable verbose compilation output
public bool VerboseOutput { get; set; }
Property Value
WarningLevel
Gets or sets the warning level (0-4)
public int WarningLevel { get; set; }
Property Value
WarningsAsErrors
Gets or sets whether to treat warnings as errors
public bool WarningsAsErrors { get; set; }
Property Value
Methods
AddDefinition(string, string)
Adds a preprocessor definition
public void AddDefinition(string name, string value = "")
Parameters
AddFlag(string)
Adds a compiler flag
public void AddFlag(string flag)
Parameters
flagstringThe compiler flag to add
AddIncludeDirectory(string)
Adds an include directory
public void AddIncludeDirectory(string directory)
Parameters
directorystringThe 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