Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
uni20::cuda::Device Class Reference

Validated CUDA device identity with cached immutable capabilities. More...

#include <device.hpp>

Public Member Functions

DeviceCapabilities const & capabilities () const
 Return this device's cached immutable hardware capabilities.
 
constexpr int ordinal () const noexcept
 Return this device's CUDA runtime ordinal.
 

Static Public Member Functions

static int count ()
 Return the number of CUDA devices visible to this process.
 
static Device current ()
 Return the CUDA device currently selected on the calling thread.
 
static std::vector< Device > enumerate ()
 Discover every visible CUDA device in ordinal order.
 
static Device get (int ordinal)
 Validate and return one CUDA device.
 

Friends

constexpr bool operator== (Device const &, Device const &)=default
 

Detailed Description

Validated CUDA device identity with cached immutable capabilities.

A Device is a cheap value containing only a device ordinal. get() validates that ordinal and initializes its process-wide capability cache. It does not own streams, schedulers, provider handles, memory pools, or allocations.

Member Function Documentation

◆ capabilities()

DeviceCapabilities const & uni20::cuda::Device::capabilities ( ) const

Return this device's cached immutable hardware capabilities.

◆ count()

int uni20::cuda::Device::count ( )
static

Return the number of CUDA devices visible to this process.

◆ current()

Device uni20::cuda::Device::current ( )
static

Return the CUDA device currently selected on the calling thread.

◆ enumerate()

std::vector< Device > uni20::cuda::Device::enumerate ( )
static

Discover every visible CUDA device in ordinal order.

Returns
Validated device values with initialized capability caches.

◆ get()

Device uni20::cuda::Device::get ( int  ordinal)
static

Validate and return one CUDA device.

Parameters
ordinalCUDA runtime device ordinal.
Returns
Cheap device value referring to the cached device record.

◆ ordinal()

constexpr int uni20::cuda::Device::ordinal ( ) const
inlineconstexprnoexcept

Return this device's CUDA runtime ordinal.

Friends And Related Symbol Documentation

◆ operator==

constexpr bool operator== ( Device const &  ,
Device const &   
)
friend

The documentation for this class was generated from the following files: