Device#
Fully qualified name: isaacsim::common::array::Device
-
class Device#
Represents a compute device, either CPU or a CUDA-capable GPU.
A Device encodes a compute target as a signed device index (ordinal). The CPU is represented by ordinal -1; CUDA devices are represented by their non-negative device index.
Instances can be constructed from an ordinal, a string descriptor (e.g.
"cpu","cuda","cuda:0"), or via the named factory methods Cpu() and Cuda().Public Functions
-
Device(details::SupportedDeviceSpecification input)#
Constructs a Device from a supported device specification.
- Parameters:
input – [in] Integer ordinal or string descriptor identifying the device.
-
Device() = delete#
-
~Device() = default#
-
bool operator==(const Device &other) const#
Checks whether two devices refer to the same compute target.
- Parameters:
other – [in] The Device to compare against.
- Returns:
trueif both devices have equal ordinals.
-
bool operator!=(const Device &other) const#
Checks whether two devices refer to different compute targets.
- Parameters:
other – [in] The Device to compare against.
- Returns:
trueif the devices have different ordinals.
-
int32_t ordinal() const#
Returns the device ordinal.
- Returns:
-1 for the CPU, or a non-negative CUDA device index.
-
bool isCpu() const#
Returns whether this device is the CPU.
- Returns:
trueif the ordinal is -1.
-
bool isCuda() const#
Returns whether this device is a CUDA GPU.
- Returns:
trueif the ordinal is non-negative.
-
bool isAvailable() const#
Returns whether this device is present and usable on the current system.
- Returns:
trueif the device is accessible at runtime.
-
Device(details::SupportedDeviceSpecification input)#