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.
Aliases
MAX_THREADS_PER_BLOCK = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](1))
: Maximum number of threads per blockMAX_BLOCK_DIM_X = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](2))
: Maximum block dimension XMAX_BLOCK_DIM_Y = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](3))
: Maximum block dimension YMAX_BLOCK_DIM_Z = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](4))
: Maximum block dimension ZMAX_GRID_DIM_X = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](5))
: Maximum grid dimension XMAX_GRID_DIM_Y = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](6))
: Maximum grid dimension YMAX_GRID_DIM_Z = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](7))
: Maximum grid dimension ZMAX_SHARED_MEMORY_PER_BLOCK = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](8))
: Maximum shared memory available per block in bytesWARP_SIZE = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](10))
: Warp size in threadsMAX_REGISTERS_PER_BLOCK = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](12))
: Maximum number of 32-bit registers available per blockCLOCK_RATE = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](13))
: Typical clock frequency in kilohertzMULTIPROCESSOR_COUNT = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](16))
: Number of multiprocessors on deviceMAX_THREADS_PER_MULTIPROCESSOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](39))
: Maximum resident threads per multiprocessorCOMPUTE_CAPABILITY_MAJOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](75))
: Major compute capability version numberCOMPUTE_CAPABILITY_MINOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](76))
: Minor compute capability version numberMAX_REGISTERS_PER_MULTIPROCESSOR = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](82))
: Maximum number of 32-bit registers available per multiprocessorMAX_ACCESS_POLICY_WINDOW_SIZE = DeviceAttribute(__init__[__mlir_type.!pop.int_literal](109))
: CUDA-only: Maximum value of CUaccessPolicyWindow::num_bytes.
Implemented traits
AnyType
,
Copyable
,
ExplicitlyCopyable
,
Movable
,
UnknownDestructibility
Methods
__init__
@implicit
__init__(value: SIMD[int32, 1]) -> Self
Initialize a DeviceAttribute with the given integer value.
This constructor allows implicit conversion from Int32 to DeviceAttribute, making it easier to use integer constants with this type.
Args:
- value (
SIMD[int32, 1]
): The integer value representing a specific device attribute.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!