Medial Code Documentation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Data Fields
xgboost::DeviceOrd Struct Reference

A type for device ordinal. More...

#include <context.h>

Public Types

enum  Type : std::int16_t { kCPU = 0 , kCUDA = 1 }
 

Public Member Functions

bool IsCUDA () const
 
bool IsCPU () const
 
constexpr DeviceOrd (Type type, bst_d_ordinal_t ord)
 
 DeviceOrd (DeviceOrd const &that)=default
 
DeviceOrdoperator= (DeviceOrd const &that)=default
 
 DeviceOrd (DeviceOrd &&that)=default
 
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.
 

Static Public Member Functions

static constexpr auto CPU ()
 Constructor for CPU.
 
static auto CUDA (bst_d_ordinal_t ordinal)
 Constructor for CUDA device.
 

Data Fields

enum xgboost::DeviceOrd::Type kCPU
 
bst_d_ordinal_t ordinal {-1}
 

Detailed Description

A type for device ordinal.

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

Member Function Documentation

◆ CUDA()

static auto xgboost::DeviceOrd::CUDA ( bst_d_ordinal_t  ordinal)
inlinestatic

Constructor for CUDA device.

Parameters
ordinalCUDA device ordinal.

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