xgboost
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
xgboost::DeviceOrd Struct Reference

A type for device ordinal. The type is packed into 32-bit for efficient use in viewing types like linalg::TensorView. More...

#include <context.h>

Collaboration diagram for xgboost::DeviceOrd:
Collaboration graph

Public Types

enum  Type : std::int16_t {
  kCPU = 0 , kCUDA = 1 , kSyclDefault = 2 , kSyclCPU = 3 ,
  kSyclGPU = 4
}
 

Public Member Functions

bool IsCUDA () const
 
bool IsCPU () const
 
bool IsSyclDefault () const
 
bool IsSyclCPU () const
 
bool IsSyclGPU () const
 
bool IsSycl () const
 
constexpr DeviceOrd ()=default
 
constexpr DeviceOrd (Type type, bst_d_ordinal_t ord)
 
constexpr DeviceOrd (DeviceOrd const &that)=default
 
constexpr DeviceOrdoperator= (DeviceOrd const &that)=default
 
constexpr DeviceOrd (DeviceOrd &&that)=default
 
constexpr DeviceOrdoperator= (DeviceOrd &&that)=default
 
bool operator== (DeviceOrd const &that) const
 
bool operator!= (DeviceOrd const &that) const
 
std::string Name () const
 Get a string representation of the device and the ordinal. More...
 

Static Public Member Functions

static constexpr bst_d_ordinal_t CPUOrdinal ()
 
static constexpr bst_d_ordinal_t InvalidOrdinal ()
 
constexpr static auto CPU ()
 Constructor for CPU. More...
 
static constexpr auto CUDA (bst_d_ordinal_t ordinal)
 Constructor for CUDA device. More...
 
constexpr static auto SyclDefault (bst_d_ordinal_t ordinal=-1)
 Constructor for SYCL. More...
 
constexpr static auto SyclCPU (bst_d_ordinal_t ordinal=-1)
 Constructor for SYCL CPU. More...
 
constexpr static auto SyclGPU (bst_d_ordinal_t ordinal=-1)
 Constructor for SYCL GPU. More...
 

Public Attributes

enum xgboost::DeviceOrd::Type kCPU
 
bst_d_ordinal_t ordinal {CPUOrdinal()}
 

Detailed Description

A type for device ordinal. The type is packed into 32-bit for efficient use in viewing types like linalg::TensorView.

Member Enumeration Documentation

◆ Type

enum xgboost::DeviceOrd::Type : std::int16_t
Enumerator
kCPU 
kCUDA 
kSyclDefault 
kSyclCPU 
kSyclGPU 

Constructor & Destructor Documentation

◆ DeviceOrd() [1/4]

constexpr xgboost::DeviceOrd::DeviceOrd ( )
constexprdefault

◆ DeviceOrd() [2/4]

constexpr xgboost::DeviceOrd::DeviceOrd ( Type  type,
bst_d_ordinal_t  ord 
)
inlineconstexpr

◆ DeviceOrd() [3/4]

constexpr xgboost::DeviceOrd::DeviceOrd ( DeviceOrd const &  that)
constexprdefault

◆ DeviceOrd() [4/4]

constexpr xgboost::DeviceOrd::DeviceOrd ( DeviceOrd &&  that)
constexprdefault

Member Function Documentation

◆ CPU()

constexpr static auto xgboost::DeviceOrd::CPU ( )
inlinestaticconstexpr

Constructor for CPU.

◆ CPUOrdinal()

static constexpr bst_d_ordinal_t xgboost::DeviceOrd::CPUOrdinal ( )
inlinestaticconstexpr

◆ CUDA()

static constexpr auto xgboost::DeviceOrd::CUDA ( bst_d_ordinal_t  ordinal)
inlinestaticconstexpr

Constructor for CUDA device.

Parameters
ordinalCUDA device ordinal.

◆ InvalidOrdinal()

static constexpr bst_d_ordinal_t xgboost::DeviceOrd::InvalidOrdinal ( )
inlinestaticconstexpr

◆ IsCPU()

bool xgboost::DeviceOrd::IsCPU ( ) const
inline

◆ IsCUDA()

bool xgboost::DeviceOrd::IsCUDA ( ) const
inline

◆ IsSycl()

bool xgboost::DeviceOrd::IsSycl ( ) const
inline

◆ IsSyclCPU()

bool xgboost::DeviceOrd::IsSyclCPU ( ) const
inline

◆ IsSyclDefault()

bool xgboost::DeviceOrd::IsSyclDefault ( ) const
inline

◆ IsSyclGPU()

bool xgboost::DeviceOrd::IsSyclGPU ( ) const
inline

◆ Name()

std::string xgboost::DeviceOrd::Name ( ) const
inline

Get a string representation of the device and the ordinal.

◆ operator!=()

bool xgboost::DeviceOrd::operator!= ( DeviceOrd const &  that) const
inline

◆ operator=() [1/2]

constexpr DeviceOrd& xgboost::DeviceOrd::operator= ( DeviceOrd &&  that)
constexprdefault

◆ operator=() [2/2]

constexpr DeviceOrd& xgboost::DeviceOrd::operator= ( DeviceOrd const &  that)
constexprdefault

◆ operator==()

bool xgboost::DeviceOrd::operator== ( DeviceOrd const &  that) const
inline

◆ SyclCPU()

constexpr static auto xgboost::DeviceOrd::SyclCPU ( bst_d_ordinal_t  ordinal = -1)
inlinestaticconstexpr

Constructor for SYCL CPU.

Parameters
ordinalSYCL CPU device ordinal.

◆ SyclDefault()

constexpr static auto xgboost::DeviceOrd::SyclDefault ( bst_d_ordinal_t  ordinal = -1)
inlinestaticconstexpr

Constructor for SYCL.

Parameters
ordinalSYCL device ordinal.

◆ SyclGPU()

constexpr static auto xgboost::DeviceOrd::SyclGPU ( bst_d_ordinal_t  ordinal = -1)
inlinestaticconstexpr

Constructor for SYCL GPU.

Parameters
ordinalSYCL GPU device ordinal.

Member Data Documentation

◆ kCPU

enum xgboost::DeviceOrd::Type xgboost::DeviceOrd::kCPU

◆ ordinal

bst_d_ordinal_t xgboost::DeviceOrd::ordinal {CPUOrdinal()}

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