34std::optional<DeviceInfo>
find_device(std::string_view uuid_or_name);
std::optional< DeviceInfo > find_device(std::string_view uuid_or_name)
Finds a device by exact UUID or by a case-sensitive substring of its name ("V100",...
constexpr std::size_t kDeviceMemoryMargin
Safety margin kept free on every device for other processes and runtime overheads.
Backend compiled_backend()
Backend compiled into this build. CPU references are always available.
bool has_free_memory(int device_index, std::size_t bytes)
True when bytes plus a safety margin fit in the device's free memory right now.
std::vector< DeviceInfo > list_devices()
All visible devices with current memory budget. Empty without an available GPU.
std::size_t free_bytes
CUDA free memory or Metal working-set headroom.
std::string uuid
CUDA UUID or Metal registry ID.
int index
backend runtime index; select by uuid/name for stability