Table of Contents

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

CacheConfig

ClockFrequency

Gets or sets the clock frequency in MHz

public int ClockFrequency { get; set; }

Property Value

int

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

decimal

ComputeCapabilityMajor

Gets or sets the compute capability major version (for CUDA devices)

public int ComputeCapabilityMajor { get; set; }

Property Value

int

ComputeCapabilityMinor

Gets or sets the compute capability minor version (for CUDA devices)

public int ComputeCapabilityMinor { get; set; }

Property Value

int

ConstantMemorySize

Gets or sets the constant memory size in bytes

public long ConstantMemorySize { get; set; }

Property Value

long

DeviceType

Gets or sets the device type

public AcceleratorType DeviceType { get; set; }

Property Value

AcceleratorType

Features

Gets or sets the available device features

public DeviceFeatures Features { get; set; }

Property Value

DeviceFeatures

GlobalMemorySize

Gets or sets the global memory size in bytes

public long GlobalMemorySize { get; set; }

Property Value

long

LocalMemorySize

Gets or sets the local memory size in bytes

public long LocalMemorySize { get; set; }

Property Value

long

MaxBlockDimensions

Gets or sets the maximum block dimensions

public Dim3 MaxBlockDimensions { get; set; }

Property Value

Dim3

MaxComputeUnits

Gets or sets the maximum number of compute units

public int MaxComputeUnits { get; set; }

Property Value

int

MaxGridDimensions

Gets or sets the maximum grid dimensions

public Dim3 MaxGridDimensions { get; set; }

Property Value

Dim3

MaxMemoryAllocationSize

Gets or sets the maximum memory allocation size in bytes

public long MaxMemoryAllocationSize { get; set; }

Property Value

long

MaxThreadsPerBlock

Gets or sets the maximum number of threads per block

public int MaxThreadsPerBlock { get; set; }

Property Value

int

MaxWorkGroupSize

Gets or sets the maximum work group size

public int MaxWorkGroupSize { get; set; }

Property Value

int

MaxWorkItemDimensions

Gets or sets the maximum work item dimensions

public int MaxWorkItemDimensions { get; set; }

Property Value

int

MaxWorkItemSizes

Gets or sets the maximum work item sizes for each dimension

public IReadOnlyList<int> MaxWorkItemSizes { get; }

Property Value

IReadOnlyList<int>

MemoryBusWidth

Gets or sets the memory bus width in bits

public int MemoryBusWidth { get; set; }

Property Value

int

MemoryClockFrequency

Gets or sets the memory clock frequency in MHz

public int MemoryClockFrequency { get; set; }

Property Value

int

SupportedDataTypes

Gets or sets the supported data types

public DataTypeSupport SupportedDataTypes { get; set; }

Property Value

DataTypeSupport

SupportsAsyncOperations

Gets or sets whether the device supports async operations

public bool SupportsAsyncOperations { get; set; }

Property Value

bool

SupportsDoublePrecision

Gets or sets whether the device supports double precision

public bool SupportsDoublePrecision { get; set; }

Property Value

bool

SupportsHalfPrecision

Gets or sets whether the device supports half precision

public bool SupportsHalfPrecision { get; set; }

Property Value

bool

SupportsNanosecondTimers

Gets or sets whether the device supports nanosecond-precision hardware timers.

public bool SupportsNanosecondTimers { get; set; }

Property Value

bool

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

bool

SupportsUnifiedMemory

Gets or sets whether the device supports unified memory

public bool SupportsUnifiedMemory { get; set; }

Property Value

bool

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

Dictionary<string, object>

WarpSize

Gets or sets the warp size (for CUDA/GPU devices)

public int WarpSize { get; set; }

Property Value

int

Methods

GetMaxMemoryBandwidth()

Gets the maximum theoretical memory bandwidth in GB/s

public double GetMaxMemoryBandwidth()

Returns

double

SupportsFeature(DeviceFeature)

Checks if the device supports a specific feature

public bool SupportsFeature(DeviceFeature feature)

Parameters

feature DeviceFeature

The feature to check

Returns

bool

True if the feature is supported, false otherwise