Table of Contents

Struct CudaDeviceProperties

Namespace
DotCompute.Backends.CUDA.Types.Native
Assembly
DotCompute.Backends.CUDA.dll

Structure containing detailed properties and capabilities of a CUDA device. This structure matches the cudaDeviceProp structure from CUDA 12.x/13.x runtime.

public struct CudaDeviceProperties : IEquatable<CudaDeviceProperties>
Implements
Inherited Members

Remarks

This structure provides comprehensive information about a CUDA device including memory limits, processing capabilities, architectural features, and supported functionality. The layout is explicitly defined to match the native CUDA structure.

IMPORTANT: CUDA 12.0+ added luid and luidDeviceNodeMask fields at offset 272-283, shifting all subsequent fields by 16 bytes. The size is 1008 bytes in CUDA 13.0.

Fields

AsyncEngineCount

The async engine count.

public int AsyncEngineCount

Field Value

int

CanMapHostMemory

The can map host memory.

public int CanMapHostMemory

Field Value

int

CanUseHostPointerForRegisteredMem

The can use host pointer for registered mem.

public int CanUseHostPointerForRegisteredMem

Field Value

int

ClockRate

The clock rate.

public int ClockRate

Field Value

int

ComputeMode

The compute mode.

public int ComputeMode

Field Value

int

ComputePreemptionSupported

The compute preemption supported.

public int ComputePreemptionSupported

Field Value

int

ConcurrentKernels

The concurrent kernels.

public int ConcurrentKernels

Field Value

int

ConcurrentManagedAccess

The concurrent managed access.

public int ConcurrentManagedAccess

Field Value

int

CooperativeLaunch

The cooperative launch.

public int CooperativeLaunch

Field Value

int

CooperativeMultiDeviceLaunch

The cooperative multi device launch.

public int CooperativeMultiDeviceLaunch

Field Value

int

DeviceOverlap

The device overlap.

public int DeviceOverlap

Field Value

int

DirectManagedMemAccessFromHost

The direct managed mem access from host.

public int DirectManagedMemAccessFromHost

Field Value

int

ECCEnabled

The e c c enabled.

public int ECCEnabled

Field Value

int

GlobalL1CacheSupported

The global l1 cache supported.

public int GlobalL1CacheSupported

Field Value

int

HostNativeAtomicSupported

The host native atomic supported.

public int HostNativeAtomicSupported

Field Value

int

Integrated

The integrated.

public int Integrated

Field Value

int

IsMultiGpuBoard

The is multi gpu board.

public int IsMultiGpuBoard

Field Value

int

KernelExecTimeoutEnabled

The kernel exec timeout enabled.

public int KernelExecTimeoutEnabled

Field Value

int

L2CacheSize

The l2 cache size.

public int L2CacheSize

Field Value

int

LocalL1CacheSupported

The local l1 cache supported.

public int LocalL1CacheSupported

Field Value

int

Luid

8-byte locally unique identifier (LUID) for the device. Added in CUDA 12.0+. Used for Windows device management.

public ulong Luid

Field Value

ulong

LuidDeviceNodeMask

Device node mask for the LUID. Added in CUDA 12.0+. Used for Windows device management.

public uint LuidDeviceNodeMask

Field Value

uint

Major

The major.

public int Major

Field Value

int

ManagedMemory

The managed memory.

public int ManagedMemory

Field Value

int

MaxGridSizeX

The max grid size x.

public int MaxGridSizeX

Field Value

int

MaxGridSizeY

The max grid size y.

public int MaxGridSizeY

Field Value

int

MaxGridSizeZ

The max grid size z.

public int MaxGridSizeZ

Field Value

int

MaxTexture1D

Maximum 1D texture size.

public int MaxTexture1D

Field Value

int

MaxTexture2DHeight

The max texture2 d height.

public int MaxTexture2DHeight

Field Value

int

MaxTexture2DWidth

The max texture2 d width.

public int MaxTexture2DWidth

Field Value

int

MaxTexture3DDepth

The max texture3 d depth.

public int MaxTexture3DDepth

Field Value

int

MaxTexture3DHeight

The max texture3 d height.

public int MaxTexture3DHeight

Field Value

int

MaxTexture3DWidth

The max texture3 d width.

public int MaxTexture3DWidth

Field Value

int

MaxThreadsDimX

The max threads dim x.

public int MaxThreadsDimX

Field Value

int

MaxThreadsDimY

The max threads dim y.

public int MaxThreadsDimY

Field Value

int

MaxThreadsDimZ

The max threads dim z.

public int MaxThreadsDimZ

Field Value

int

MaxThreadsPerBlock

The max threads per block.

public int MaxThreadsPerBlock

Field Value

int

MaxThreadsPerMultiProcessor

The max threads per multi processor.

public int MaxThreadsPerMultiProcessor

Field Value

int

MemBusWidth

The mem bus width.

public int MemBusWidth

Field Value

int

MemClockRate

The mem clock rate.

public int MemClockRate

Field Value

int

MemPitch

The mem pitch.

public ulong MemPitch

Field Value

ulong

Minor

The minor.

public int Minor

Field Value

int

MultiGpuBoardGroupID

The multi gpu board group i d.

public int MultiGpuBoardGroupID

Field Value

int

MultiProcessorCount

The multi processor count.

public int MultiProcessorCount

Field Value

int

Name

The name.

public sbyte* Name

Field Value

sbyte*

PageableMemoryAccess

The pageable memory access.

public int PageableMemoryAccess

Field Value

int

PageableMemoryAccessUsesHostPageTables

The pageable memory access uses host page tables.

public int PageableMemoryAccessUsesHostPageTables

Field Value

int

PciBusID

The pci bus i d.

public int PciBusID

Field Value

int

PciDeviceID

The pci device i d.

public int PciDeviceID

Field Value

int

PciDomainID

The pci domain i d.

public int PciDomainID

Field Value

int

PersistingL2CacheMaxSize

The persisting l2 cache max size.

public int PersistingL2CacheMaxSize

Field Value

int

RegsPerBlock

The regs per block.

public int RegsPerBlock

Field Value

int

RegsPerMultiprocessor

The regs per multiprocessor.

public int RegsPerMultiprocessor

Field Value

int

SharedMemPerBlock

The shared mem per block.

public ulong SharedMemPerBlock

Field Value

ulong

SharedMemPerBlockOptin

The shared mem per block optin.

public ulong SharedMemPerBlockOptin

Field Value

ulong

SharedMemPerMultiprocessor

The shared mem per multiprocessor.

public ulong SharedMemPerMultiprocessor

Field Value

ulong

SingleToDoublePrecisionPerfRatio

The single to double precision perf ratio.

public int SingleToDoublePrecisionPerfRatio

Field Value

int

StreamPrioritiesSupported

The stream priorities supported.

public int StreamPrioritiesSupported

Field Value

int

TccDriver

The tcc driver.

public int TccDriver

Field Value

int

TextureAlignment

The texture alignment.

public ulong TextureAlignment

Field Value

ulong

TexturePitchAlignment

The texture pitch alignment.

public ulong TexturePitchAlignment

Field Value

ulong

TotalConstMem

The total const mem.

public ulong TotalConstMem

Field Value

ulong

TotalGlobalMem

The total global mem.

public ulong TotalGlobalMem

Field Value

ulong

UnifiedAddressing

The unified addressing.

public int UnifiedAddressing

Field Value

int

UuidHigh

The uuid high.

public ulong UuidHigh

Field Value

ulong

UuidLow

The uuid low.

public ulong UuidLow

Field Value

ulong

WarpSize

The warp size.

public int WarpSize

Field Value

int

Properties

DeviceName

Gets the device name as a managed string.

public string DeviceName { get; }

Property Value

string

ManagedMemorySupported

Gets a corrected managed memory value that accounts for known device issues. Use this property instead of the raw ManagedMemory field for accurate detection.

public bool ManagedMemorySupported { get; }

Property Value

bool

MaxGridDim

Maximum dimensions of a grid of thread blocks as an array [x, y, z] (alias for MaxGridSize).

public IReadOnlyList<int> MaxGridDim { get; }

Property Value

IReadOnlyList<int>

MaxGridSize

Maximum dimensions of a grid of thread blocks as an array [x, y, z].

public IReadOnlyList<int> MaxGridSize { get; }

Property Value

IReadOnlyList<int>

MaxGridSizePtr

Maximum dimensions of a grid of thread blocks [x, y, z].

public int* MaxGridSizePtr { get; }

Property Value

int*

MaxTexture2D

Maximum 2D texture dimensions as array.

public IReadOnlyList<int> MaxTexture2D { get; }

Property Value

IReadOnlyList<int>

MaxTexture3D

Maximum 3D texture dimensions as array.

public IReadOnlyList<int> MaxTexture3D { get; }

Property Value

IReadOnlyList<int>

MaxThreadsDim

Maximum dimensions of a thread block as an array [x, y, z].

public IReadOnlyList<int> MaxThreadsDim { get; }

Property Value

IReadOnlyList<int>

MaxThreadsDimPtr

Maximum dimensions of a thread block [x, y, z].

public int* MaxThreadsDimPtr { get; }

Property Value

int*

MemoryBusWidth

Alias for MemBusWidth for compatibility.

public int MemoryBusWidth { get; }

Property Value

int

MemoryClockRate

Alias for MemClockRate for compatibility.

public int MemoryClockRate { get; }

Property Value

int

PciBusId

Alias for PciBusID for compatibility.

public int PciBusId { get; }

Property Value

int

PciDeviceId

Alias for PciDeviceID for compatibility.

public int PciDeviceId { get; }

Property Value

int

PciDomainId

Alias for PciDomainID for compatibility.

public int PciDomainId { get; }

Property Value

int

Methods

Equals(CudaDeviceProperties)

Determines whether this instance is equal to another CudaDeviceProperties.

public readonly bool Equals(CudaDeviceProperties other)

Parameters

other CudaDeviceProperties

The other instance to compare.

Returns

bool

True if equal; otherwise, false.

Equals(object?)

Determines whether this instance is equal to another object.

public override readonly bool Equals(object? obj)

Parameters

obj object

The object to compare.

Returns

bool

True if equal; otherwise, false.

GetActualManagedMemorySupport(int)

Validates and corrects managed memory detection for RTX 2000 Ada and similar devices. This method provides a robust fallback when the struct field returns incorrect values.

public bool GetActualManagedMemorySupport(int deviceId)

Parameters

deviceId int

Returns

bool

GetHashCode()

Gets the hash code for this instance.

public override readonly int GetHashCode()

Returns

int

The hash code.

Operators

operator ==(CudaDeviceProperties, CudaDeviceProperties)

Determines whether two CudaDeviceProperties instances are equal.

public static bool operator ==(CudaDeviceProperties left, CudaDeviceProperties right)

Parameters

left CudaDeviceProperties

The left operand.

right CudaDeviceProperties

The right operand.

Returns

bool

True if equal; otherwise, false.

operator !=(CudaDeviceProperties, CudaDeviceProperties)

Determines whether two CudaDeviceProperties instances are not equal.

public static bool operator !=(CudaDeviceProperties left, CudaDeviceProperties right)

Parameters

left CudaDeviceProperties

The left operand.

right CudaDeviceProperties

The right operand.

Returns

bool

True if not equal; otherwise, false.