Open3D (C++ API)
0.17.0
|
#include <Device.h>
Public Types | |
enum class | DeviceType { CPU = 0 , CUDA = 1 , SYCL = 2 } |
Type for device. More... | |
Public Member Functions | |
Device ()=default | |
Default constructor -> "CPU:0". More... | |
Device (DeviceType device_type, int device_id) | |
Constructor with device specified. More... | |
Device (const std::string &device_type, int device_id) | |
Constructor from device type string and device id. More... | |
Device (const std::string &type_colon_id) | |
Constructor from string, e.g. "CUDA:0". More... | |
bool | operator== (const Device &other) const |
bool | operator!= (const Device &other) const |
bool | operator< (const Device &other) const |
bool | IsCPU () const |
Returns true iff device type is CPU. More... | |
bool | IsCUDA () const |
Returns true iff device type is CUDA. More... | |
bool | IsSYCL () const |
Returns true iff device type is SYCL GPU. More... | |
std::string | ToString () const |
Returns string representation of device, e.g. "CPU:0", "CUDA:0". More... | |
DeviceType | GetType () const |
Returns type of the device, e.g. DeviceType::CPU, DeviceType::CUDA. More... | |
int | GetID () const |
Returns the device index (within the same device type). More... | |
bool | IsAvailable () const |
Returns true if the device is available. More... | |
Static Public Member Functions | |
static std::vector< Device > | GetAvailableDevices () |
Returns a vector of available devices. More... | |
static std::vector< Device > | GetAvailableCPUDevices () |
Returns a vector of available CPU device. More... | |
static std::vector< Device > | GetAvailableCUDADevices () |
Returns a vector of available CUDA device. More... | |
static std::vector< Device > | GetAvailableSYCLDevices () |
Returns a vector of available SYCL device. More... | |
static void | PrintAvailableDevices () |
Print all available devices. More... | |
Protected Attributes | |
DeviceType | device_type_ = DeviceType::CPU |
int | device_id_ = 0 |
Device context specifying device type and device id. For CPU, there is only one device with id 0.
|
strong |
|
default |
Default constructor -> "CPU:0".
|
explicit |
Constructor with device specified.
|
explicit |
Constructor from device type string and device id.
|
explicit |
Constructor from string, e.g. "CUDA:0".
|
static |
Returns a vector of available CPU device.
|
static |
Returns a vector of available CUDA device.
|
static |
Returns a vector of available devices.
|
static |
Returns a vector of available SYCL device.
|
inline |
Returns the device index (within the same device type).
|
inline |
Returns type of the device, e.g. DeviceType::CPU, DeviceType::CUDA.
bool open3d::core::Device::IsAvailable | ( | ) | const |
Returns true if the device is available.
|
inline |
Returns true iff device type is CPU.
|
inline |
Returns true iff device type is CUDA.
|
inline |
Returns true iff device type is SYCL GPU.
bool open3d::core::Device::operator!= | ( | const Device & | other | ) | const |
bool open3d::core::Device::operator< | ( | const Device & | other | ) | const |
bool open3d::core::Device::operator== | ( | const Device & | other | ) | const |
|
static |
Print all available devices.
std::string open3d::core::Device::ToString | ( | ) | const |
Returns string representation of device, e.g. "CPU:0", "CUDA:0".
|
protected |
|
protected |