Class DeviceCapabilities
- Namespace
- DotCompute.Abstractions.Models
- Assembly
- DotCompute.Abstractions.dll
Represents the capabilities and features of a compute device
public sealed class DeviceCapabilities
- Inheritance
-
DeviceCapabilities
- Inherited Members
Constructors
DeviceCapabilities()
Creates a new instance of DeviceCapabilities
public DeviceCapabilities()
Properties
CacheConfiguration
Gets or sets the device's cache configuration
public CacheConfig CacheConfiguration { get; set; }
Property Value
ClockFrequency
Gets or sets the clock frequency in MHz
public int ClockFrequency { get; set; }
Property Value
ClockFrequencyHz
Gets or sets the GPU hardware clock frequency in Hertz (cycles per second).
public long ClockFrequencyHz { get; set; }
Property Value
- long
The timer clock frequency in Hz. Typical values: 1 GHz (CUDA nanosecond), 1 MHz (CUDA events), Stopwatch.Frequency (CPU).
Remarks
This frequency determines the timer resolution: resolution = 1 / frequency.
ComputeCapability
Gets the compute capability as a decimal value
public decimal ComputeCapability { get; }
Property Value
ComputeCapabilityMajor
Gets or sets the compute capability major version (for CUDA devices)
public int ComputeCapabilityMajor { get; set; }
Property Value
ComputeCapabilityMinor
Gets or sets the compute capability minor version (for CUDA devices)
public int ComputeCapabilityMinor { get; set; }
Property Value
ConstantMemorySize
Gets or sets the constant memory size in bytes
public long ConstantMemorySize { get; set; }
Property Value
DeviceType
Gets or sets the device type
public AcceleratorType DeviceType { get; set; }
Property Value
Features
Gets or sets the available device features
public DeviceFeatures Features { get; set; }
Property Value
GlobalMemorySize
Gets or sets the global memory size in bytes
public long GlobalMemorySize { get; set; }
Property Value
LocalMemorySize
Gets or sets the local memory size in bytes
public long LocalMemorySize { get; set; }
Property Value
MaxBlockDimensions
Gets or sets the maximum block dimensions
public Dim3 MaxBlockDimensions { get; set; }
Property Value
MaxComputeUnits
Gets or sets the maximum number of compute units
public int MaxComputeUnits { get; set; }
Property Value
MaxGridDimensions
Gets or sets the maximum grid dimensions
public Dim3 MaxGridDimensions { get; set; }
Property Value
MaxMemoryAllocationSize
Gets or sets the maximum memory allocation size in bytes
public long MaxMemoryAllocationSize { get; set; }
Property Value
MaxThreadsPerBlock
Gets or sets the maximum number of threads per block
public int MaxThreadsPerBlock { get; set; }
Property Value
MaxWorkGroupSize
Gets or sets the maximum work group size
public int MaxWorkGroupSize { get; set; }
Property Value
MaxWorkItemDimensions
Gets or sets the maximum work item dimensions
public int MaxWorkItemDimensions { get; set; }
Property Value
MaxWorkItemSizes
Gets or sets the maximum work item sizes for each dimension
public IReadOnlyList<int> MaxWorkItemSizes { get; }
Property Value
MemoryBusWidth
Gets or sets the memory bus width in bits
public int MemoryBusWidth { get; set; }
Property Value
MemoryClockFrequency
Gets or sets the memory clock frequency in MHz
public int MemoryClockFrequency { get; set; }
Property Value
SupportedDataTypes
Gets or sets the supported data types
public DataTypeSupport SupportedDataTypes { get; set; }
Property Value
SupportsAsyncOperations
Gets or sets whether the device supports async operations
public bool SupportsAsyncOperations { get; set; }
Property Value
SupportsDoublePrecision
Gets or sets whether the device supports double precision
public bool SupportsDoublePrecision { get; set; }
Property Value
SupportsHalfPrecision
Gets or sets whether the device supports half precision
public bool SupportsHalfPrecision { get; set; }
Property Value
SupportsNanosecondTimers
Gets or sets whether the device supports nanosecond-precision hardware timers.
public bool SupportsNanosecondTimers { get; set; }
Property Value
Remarks
Nanosecond precision is available on:
- CUDA: Compute Capability 6.0+ (%%globaltimer register)
- OpenCL: Platform-dependent (typically microsecond precision)
- CPU: Depends on Stopwatch resolution (~100ns typical)
SupportsPeerToPeerAccess
Gets or sets whether the device supports peer-to-peer memory access
public bool SupportsPeerToPeerAccess { get; set; }
Property Value
SupportsUnifiedMemory
Gets or sets whether the device supports unified memory
public bool SupportsUnifiedMemory { get; set; }
Property Value
TimerResolutionNanos
Gets or sets the hardware timer resolution in nanoseconds.
public long TimerResolutionNanos { get; set; }
Property Value
- long
The minimum measurable time interval in nanoseconds. Lower values indicate higher precision. Typical values: 1 ns (CUDA CC 6.0+), 1,000 ns (CUDA events, OpenCL), ~100 ns (CPU).
VendorProperties
Gets or sets additional vendor-specific properties
public Dictionary<string, object> VendorProperties { get; }
Property Value
WarpSize
Gets or sets the warp size (for CUDA/GPU devices)
public int WarpSize { get; set; }
Property Value
Methods
GetMaxMemoryBandwidth()
Gets the maximum theoretical memory bandwidth in GB/s
public double GetMaxMemoryBandwidth()
Returns
SupportsFeature(DeviceFeature)
Checks if the device supports a specific feature
public bool SupportsFeature(DeviceFeature feature)
Parameters
featureDeviceFeatureThe feature to check
Returns
- bool
True if the feature is supported, false otherwise