Class CompilationOptions
- Namespace
- DotCompute.Abstractions
- Assembly
- DotCompute.Abstractions.dll
Comprehensive compilation options for kernel compilation across different backends
public class CompilationOptions
- Inheritance
-
CompilationOptions
- Derived
- Inherited Members
- Extension Methods
Properties
AdditionalFlags
Additional compiler flags
public IList<string> AdditionalFlags { get; }
Property Value
AggressiveOptimizations
Enable aggressive optimizations
public bool AggressiveOptimizations { get; set; }
Property Value
AllowUnsafeCode
Allow unsafe code during compilation
public bool AllowUnsafeCode { get; set; }
Property Value
CompilationTimeout
Maximum compilation time before timeout
[Range(typeof(TimeSpan), "00:00:01", "00:10:00")]
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
public TimeSpan CompilationTimeout { get; set; }
Property Value
CompileToCubin
Whether to compile to CUBIN format instead of PTX
public bool CompileToCubin { get; set; }
Property Value
CompilerBackend
Compiler backend to use
public string? CompilerBackend { get; set; }
Property Value
ComputeCapability
Target compute capability version for compilation
public Version ComputeCapability { get; set; }
Property Value
Debug
Debug-optimized compilation options
public static CompilationOptions Debug { get; }
Property Value
Default
Default compilation options
public static CompilationOptions Default { get; }
Property Value
Defines
Compiler-specific defines
public Dictionary<string, string> Defines { get; }
Property Value
EnableDebugInfo
Enable debug information generation
public bool EnableDebugInfo { get; set; }
Property Value
EnableDeviceDebugging
Enable device-level debugging (alias for EnableDebugInfo)
public bool EnableDeviceDebugging { get; set; }
Property Value
EnableDynamicParallelism
Enable dynamic parallelism support for CUDA kernels Allows kernels to launch other kernels from GPU code
public bool EnableDynamicParallelism { get; set; }
Property Value
EnableFastMath
Enable fast math optimizations (may reduce precision)
public bool EnableFastMath { get; set; }
Property Value
EnableInlining
Enable inline function optimizations
public bool EnableInlining { get; set; }
Property Value
EnableL2CacheResidencyControl
Enable L2 cache residency control (CUDA 13.0+ on Ampere and newer)
public bool EnableL2CacheResidencyControl { get; set; }
Property Value
EnableLoopUnrolling
Enable loop unrolling optimizations
public bool EnableLoopUnrolling { get; set; }
Property Value
EnableMemoryCoalescing
Enable memory coalescing optimizations
public bool EnableMemoryCoalescing { get; set; }
Property Value
EnableOperatorFusion
Enable operator fusion optimizations
public bool EnableOperatorFusion { get; set; }
Property Value
EnableParallelExecution
Enable parallel execution
public bool EnableParallelExecution { get; set; }
Property Value
EnableProfileGuidedOptimizations
Enable profile-guided optimizations
public bool EnableProfileGuidedOptimizations { get; set; }
Property Value
EnableProfiling
Enable profiling support during compilation and execution
public bool EnableProfiling { get; set; }
Property Value
EnableSharedMemoryRegisterSpilling
Enable shared memory register spilling for CUDA 13.0+ (Turing and newer) Helps reduce register pressure by spilling to shared memory instead of local memory
public bool EnableSharedMemoryRegisterSpilling { get; set; }
Property Value
EnableTileBasedProgramming
Enable tile-based programming patterns for tensor cores (CUDA 13.0+)
public bool EnableTileBasedProgramming { get; set; }
Property Value
EnableVectorization
Enable vectorization optimizations
public bool EnableVectorization { get; set; }
Property Value
FastMath
Enable fast math optimizations (alias for compatibility)
public bool FastMath { get; set; }
Property Value
FloatingPointMode
Floating point precision mode
public FloatingPointMode FloatingPointMode { get; set; }
Property Value
ForceInterpretedMode
Force interpreted mode instead of compiled
public bool ForceInterpretedMode { get; set; }
Property Value
FusedMultiplyAdd
Enable fused multiply-add operations
public bool FusedMultiplyAdd { get; set; }
Property Value
GenerateDebugInfo
Generate debug information (alias for EnableDebugInfo)
public bool GenerateDebugInfo { get; set; }
Property Value
GenerateLineInfo
Generate line information for debugging
public bool GenerateLineInfo { get; set; }
Property Value
IncludePaths
Include paths for headers
public IList<string> IncludePaths { get; }
Property Value
MaxRegisters
Maximum register usage for GPU kernels
[Range(1, 255)]
public int? MaxRegisters { get; set; }
Property Value
- int?
MaxRegistersPerThread
Maximum registers per thread for GPU kernel execution (CUDA-specific)
[Range(0, 255)]
public int MaxRegistersPerThread { get; set; }
Property Value
Remarks
Controls the maximum number of registers that each thread can use. Setting this to 0 allows the compiler to use any number of registers. Lower values can increase occupancy but may reduce performance. Typical values range from 32 to 255 registers per thread.
OptimizationLevel
Target optimization level
public OptimizationLevel OptimizationLevel { get; set; }
Property Value
PreferredBlockSize
Preferred block dimensions for GPU kernel execution
[Range(1, 2147483647)]
public Dim3? PreferredBlockSize { get; set; }
Property Value
- Dim3?
ProfileDataPath
Profile data path for PGO
public string? ProfileDataPath { get; set; }
Property Value
Release
Release-optimized compilation options
public static CompilationOptions Release { get; }
Property Value
RelocatableDeviceCode
Generate relocatable device code
public bool RelocatableDeviceCode { get; set; }
Property Value
SharedMemoryLimit
Shared memory usage limit for GPU kernels (in bytes)
[Range(0, 2147483647)]
public int? SharedMemoryLimit { get; set; }
Property Value
- int?
SharedMemorySize
Dynamic shared memory size allocation (in bytes)
[Range(0, 2147483647)]
public int? SharedMemorySize { get; set; }
Property Value
- int?
StrictFloatingPoint
Enable strict floating point semantics
public bool StrictFloatingPoint { get; set; }
Property Value
TargetArchitecture
Target architecture specific optimizations
public string? TargetArchitecture { get; set; }
Property Value
ThreadBlockSize
Thread block size hint
public int? ThreadBlockSize { get; set; }
Property Value
- int?
TreatWarningsAsErrors
Enable warnings as errors
public bool TreatWarningsAsErrors { get; set; }
Property Value
UnrollLoops
Enable loop unrolling optimizations
public bool UnrollLoops { get; set; }
Property Value
UseFastMath
Use fast math optimizations (alias for EnableFastMath)
public bool UseFastMath { get; set; }
Property Value
UseNativeMathLibrary
Enable native math library usage
public bool UseNativeMathLibrary { get; set; }
Property Value
WarningLevel
Warning level (0-4)
[Range(0, 4)]
public int WarningLevel { get; set; }
Property Value
Methods
Clone()
Creates a copy of the compilation options
public CompilationOptions Clone()
Returns
ToString()
Converts to string.
public override string ToString()