Skip to main content
Log in

Mojo struct

DeviceAttribute

@register_passable(trivial) struct DeviceAttribute

Represents CUDA device attributes that can be queried from a GPU device.

This struct encapsulates the various device properties and capabilities that can be queried through the CUDA driver API. Each attribute is represented as a constant with a corresponding integer value that maps to the CUDA driver's attribute enum.

Implemented traits

AnyType, Copyable, Movable, UnknownDestructibility

Aliases

CLOCK_RATE

alias CLOCK_RATE = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](13))

Typical clock frequency in kilohertz

COMPUTE_CAPABILITY_MAJOR

alias COMPUTE_CAPABILITY_MAJOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](75))

Major compute capability version number

COMPUTE_CAPABILITY_MINOR

alias COMPUTE_CAPABILITY_MINOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](76))

Minor compute capability version number

MAX_ACCESS_POLICY_WINDOW_SIZE

alias MAX_ACCESS_POLICY_WINDOW_SIZE = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](109))

CUDA-only: Maximum value of CUaccessPolicyWindow::num_bytes.

MAX_BLOCK_DIM_X

alias MAX_BLOCK_DIM_X = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](2))

Maximum block dimension X

MAX_BLOCK_DIM_Y

alias MAX_BLOCK_DIM_Y = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](3))

Maximum block dimension Y

MAX_BLOCK_DIM_Z

alias MAX_BLOCK_DIM_Z = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](4))

Maximum block dimension Z

MAX_BLOCKS_PER_MULTIPROCESSOR

alias MAX_BLOCKS_PER_MULTIPROCESSOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](106))

Maximum resident blocks per multiprocessor

MAX_GRID_DIM_X

alias MAX_GRID_DIM_X = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](5))

Maximum grid dimension X

MAX_GRID_DIM_Y

alias MAX_GRID_DIM_Y = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](6))

Maximum grid dimension Y

MAX_GRID_DIM_Z

alias MAX_GRID_DIM_Z = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](7))

Maximum grid dimension Z

MAX_REGISTERS_PER_BLOCK

alias MAX_REGISTERS_PER_BLOCK = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](12))

Maximum number of 32-bit registers available per block

MAX_REGISTERS_PER_MULTIPROCESSOR

alias MAX_REGISTERS_PER_MULTIPROCESSOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](82))

Maximum number of 32-bit registers available per multiprocessor

MAX_SHARED_MEMORY_PER_BLOCK

alias MAX_SHARED_MEMORY_PER_BLOCK = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](8))

Maximum shared memory available per block in bytes

MAX_SHARED_MEMORY_PER_MULTIPROCESSOR

alias MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](81))

Maximum shared memory available per multiprocessor in bytes

MAX_THREADS_PER_BLOCK

alias MAX_THREADS_PER_BLOCK = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](1))

Maximum number of threads per block

MAX_THREADS_PER_MULTIPROCESSOR

alias MAX_THREADS_PER_MULTIPROCESSOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](39))

Maximum resident threads per multiprocessor

MULTIPROCESSOR_COUNT

alias MULTIPROCESSOR_COUNT = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](16))

Number of multiprocessors on device

WARP_SIZE

alias WARP_SIZE = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](10))

Warp size in threads

Was this page helpful?