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
CanMapHostMemory
The can map host memory.
public int CanMapHostMemory
Field Value
CanUseHostPointerForRegisteredMem
The can use host pointer for registered mem.
public int CanUseHostPointerForRegisteredMem
Field Value
ClockRate
The clock rate.
public int ClockRate
Field Value
ComputeMode
The compute mode.
public int ComputeMode
Field Value
ComputePreemptionSupported
The compute preemption supported.
public int ComputePreemptionSupported
Field Value
ConcurrentKernels
The concurrent kernels.
public int ConcurrentKernels
Field Value
ConcurrentManagedAccess
The concurrent managed access.
public int ConcurrentManagedAccess
Field Value
CooperativeLaunch
The cooperative launch.
public int CooperativeLaunch
Field Value
CooperativeMultiDeviceLaunch
The cooperative multi device launch.
public int CooperativeMultiDeviceLaunch
Field Value
DeviceOverlap
The device overlap.
public int DeviceOverlap
Field Value
DirectManagedMemAccessFromHost
The direct managed mem access from host.
public int DirectManagedMemAccessFromHost
Field Value
ECCEnabled
The e c c enabled.
public int ECCEnabled
Field Value
GlobalL1CacheSupported
The global l1 cache supported.
public int GlobalL1CacheSupported
Field Value
HostNativeAtomicSupported
The host native atomic supported.
public int HostNativeAtomicSupported
Field Value
Integrated
The integrated.
public int Integrated
Field Value
IsMultiGpuBoard
The is multi gpu board.
public int IsMultiGpuBoard
Field Value
KernelExecTimeoutEnabled
The kernel exec timeout enabled.
public int KernelExecTimeoutEnabled
Field Value
L2CacheSize
The l2 cache size.
public int L2CacheSize
Field Value
LocalL1CacheSupported
The local l1 cache supported.
public int LocalL1CacheSupported
Field Value
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
LuidDeviceNodeMask
Device node mask for the LUID. Added in CUDA 12.0+. Used for Windows device management.
public uint LuidDeviceNodeMask
Field Value
Major
The major.
public int Major
Field Value
ManagedMemory
The managed memory.
public int ManagedMemory
Field Value
MaxGridSizeX
The max grid size x.
public int MaxGridSizeX
Field Value
MaxGridSizeY
The max grid size y.
public int MaxGridSizeY
Field Value
MaxGridSizeZ
The max grid size z.
public int MaxGridSizeZ
Field Value
MaxTexture1D
Maximum 1D texture size.
public int MaxTexture1D
Field Value
MaxTexture2DHeight
The max texture2 d height.
public int MaxTexture2DHeight
Field Value
MaxTexture2DWidth
The max texture2 d width.
public int MaxTexture2DWidth
Field Value
MaxTexture3DDepth
The max texture3 d depth.
public int MaxTexture3DDepth
Field Value
MaxTexture3DHeight
The max texture3 d height.
public int MaxTexture3DHeight
Field Value
MaxTexture3DWidth
The max texture3 d width.
public int MaxTexture3DWidth
Field Value
MaxThreadsDimX
The max threads dim x.
public int MaxThreadsDimX
Field Value
MaxThreadsDimY
The max threads dim y.
public int MaxThreadsDimY
Field Value
MaxThreadsDimZ
The max threads dim z.
public int MaxThreadsDimZ
Field Value
MaxThreadsPerBlock
The max threads per block.
public int MaxThreadsPerBlock
Field Value
MaxThreadsPerMultiProcessor
The max threads per multi processor.
public int MaxThreadsPerMultiProcessor
Field Value
MemBusWidth
The mem bus width.
public int MemBusWidth
Field Value
MemClockRate
The mem clock rate.
public int MemClockRate
Field Value
MemPitch
The mem pitch.
public ulong MemPitch
Field Value
Minor
The minor.
public int Minor
Field Value
MultiGpuBoardGroupID
The multi gpu board group i d.
public int MultiGpuBoardGroupID
Field Value
MultiProcessorCount
The multi processor count.
public int MultiProcessorCount
Field Value
Name
The name.
public sbyte* Name
Field Value
PageableMemoryAccess
The pageable memory access.
public int PageableMemoryAccess
Field Value
PageableMemoryAccessUsesHostPageTables
The pageable memory access uses host page tables.
public int PageableMemoryAccessUsesHostPageTables
Field Value
PciBusID
The pci bus i d.
public int PciBusID
Field Value
PciDeviceID
The pci device i d.
public int PciDeviceID
Field Value
PciDomainID
The pci domain i d.
public int PciDomainID
Field Value
PersistingL2CacheMaxSize
The persisting l2 cache max size.
public int PersistingL2CacheMaxSize
Field Value
RegsPerBlock
The regs per block.
public int RegsPerBlock
Field Value
RegsPerMultiprocessor
The regs per multiprocessor.
public int RegsPerMultiprocessor
Field Value
SharedMemPerBlock
The shared mem per block.
public ulong SharedMemPerBlock
Field Value
SharedMemPerBlockOptin
The shared mem per block optin.
public ulong SharedMemPerBlockOptin
Field Value
SharedMemPerMultiprocessor
The shared mem per multiprocessor.
public ulong SharedMemPerMultiprocessor
Field Value
SingleToDoublePrecisionPerfRatio
The single to double precision perf ratio.
public int SingleToDoublePrecisionPerfRatio
Field Value
StreamPrioritiesSupported
The stream priorities supported.
public int StreamPrioritiesSupported
Field Value
TccDriver
The tcc driver.
public int TccDriver
Field Value
TextureAlignment
The texture alignment.
public ulong TextureAlignment
Field Value
TexturePitchAlignment
The texture pitch alignment.
public ulong TexturePitchAlignment
Field Value
TotalConstMem
The total const mem.
public ulong TotalConstMem
Field Value
TotalGlobalMem
The total global mem.
public ulong TotalGlobalMem
Field Value
UnifiedAddressing
The unified addressing.
public int UnifiedAddressing
Field Value
UuidHigh
The uuid high.
public ulong UuidHigh
Field Value
UuidLow
The uuid low.
public ulong UuidLow
Field Value
WarpSize
The warp size.
public int WarpSize
Field Value
Properties
DeviceName
Gets the device name as a managed string.
public string DeviceName { get; }
Property Value
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
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
MaxGridSize
Maximum dimensions of a grid of thread blocks as an array [x, y, z].
public IReadOnlyList<int> MaxGridSize { get; }
Property Value
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
MaxTexture3D
Maximum 3D texture dimensions as array.
public IReadOnlyList<int> MaxTexture3D { get; }
Property Value
MaxThreadsDim
Maximum dimensions of a thread block as an array [x, y, z].
public IReadOnlyList<int> MaxThreadsDim { get; }
Property Value
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
MemoryClockRate
Alias for MemClockRate for compatibility.
public int MemoryClockRate { get; }
Property Value
PciBusId
Alias for PciBusID for compatibility.
public int PciBusId { get; }
Property Value
PciDeviceId
Alias for PciDeviceID for compatibility.
public int PciDeviceId { get; }
Property Value
PciDomainId
Alias for PciDomainID for compatibility.
public int PciDomainId { get; }
Property Value
Methods
Equals(CudaDeviceProperties)
Determines whether this instance is equal to another CudaDeviceProperties.
public readonly bool Equals(CudaDeviceProperties other)
Parameters
otherCudaDevicePropertiesThe 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
objobjectThe 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
deviceIdint
Returns
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
leftCudaDevicePropertiesThe left operand.
rightCudaDevicePropertiesThe 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
leftCudaDevicePropertiesThe left operand.
rightCudaDevicePropertiesThe right operand.
Returns
- bool
True if not equal; otherwise, false.