xpu
xpu::device Class Reference

Public Member Functions

 device ()
 Construct CPU device. More...
 
 device (std::string_view xpuid)
 Lookup device by string. More...
 
 device (int id)
 Construct device from device id. More...
 
 device (driver_t driver, int device_nr)
 Construct device from driver and device number. More...
 
 device (const device &)=default
 
 device (device &&)=default
 
deviceoperator= (const device &)=default
 
deviceoperator= (device &&)=default
 
int id () const
 Get the device id. More...
 
driver_t backend () const
 Get the backend associated with the device. More...
 
int device_nr () const
 Get the device number within the backend. More...
 
 device (detail::device impl)
 
detail::device & impl ()
 

Static Public Member Functions

static std::vector< deviceall ()
 Get all available devices. More...
 
static device active ()
 Get the active device. More...
 

Detailed Description

Represents a device found on the system.

Constructor & Destructor Documentation

◆ device() [1/7]

xpu::device::device ( )

Construct CPU device.

◆ device() [2/7]

xpu::device::device ( std::string_view  xpuid)
explicit

Lookup device by string.

See also
xpu::settings::device for possible values.

◆ device() [3/7]

xpu::device::device ( int  id)
explicit

Construct device from device id.

Parameters
idDevice id. The device id is a unique number assigned to each device. It is also the index of the device in the vector returned by device::all().

◆ device() [4/7]

xpu::device::device ( driver_t  driver,
int  device_nr 
)
explicit

Construct device from driver and device number.

◆ device() [5/7]

xpu::device::device ( const device )
default

◆ device() [6/7]

xpu::device::device ( device &&  )
default

◆ device() [7/7]

xpu::device::device ( detail::device  impl)
inlineexplicit

Member Function Documentation

◆ active()

static device xpu::device::active ( )
static

Get the active device.

◆ all()

static std::vector<device> xpu::device::all ( )
static

Get all available devices.

◆ backend()

driver_t xpu::device::backend ( ) const
inline

Get the backend associated with the device.

◆ device_nr()

int xpu::device::device_nr ( ) const
inline

Get the device number within the backend.

◆ id()

int xpu::device::id ( ) const
inline

Get the device id.

◆ impl()

detail::device& xpu::device::impl ( )
inline

◆ operator=() [1/2]

device& xpu::device::operator= ( const device )
default

◆ operator=() [2/2]

device& xpu::device::operator= ( device &&  )
default

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