tenzr::HardwareManager¶
Owns the loaded PJRT plugin and client, exposing device enumeration and platform metadata.
#include <hardware_manager.h>
Public Classes¶
| Name | |
|---|---|
| struct | DeviceMemoryStats Device allocator statistics (from PJRT_Device_MemoryStats when the plugin supports it). |
Public Functions¶
| Name | |
|---|---|
| HardwareManager & | Instance() Access the singleton hardware manager. |
| HardwareManager() | |
| ~HardwareManager() Release the PJRT client and loaded plugin on teardown. |
|
| HardwareManager(const HardwareManager & ) =delete | |
| HardwareManager & | operator=(const HardwareManager & ) =delete |
| void | Initialize(const std::string & preferred_plugin_path ="") |
| void | Shutdown() Tear down the client and unload the plugin. |
| bool | IsInitialized() const Whether a PJRT client has been initialized. |
| const PJRT_Api * | Api() const Underlying PJRT API table. |
| PJRT_Client * | Client() const Underlying PJRT client. |
| const std::string & | PlatformName() const Name of the loaded platform. |
| const std::string & | PlatformVersion() const Version of the loaded platform. |
| const std::string & | LoadedPluginPath() const Path of the loaded PJRT plugin. |
| const std::vector< DeviceInfo > & | Devices() const All discovered devices, in platform order. |
| PJRT_Device * | DefaultDevice() const The default device used for execution. |
| const PJRT_Extension_Base * | Extension(PJRT_Extension_Type type) const Cached plugin extension of the given type, or nullptr when the plugin lacks it. |
| DeviceMemoryStats | MemoryStats(PJRT_Device * device =nullptr) const Memory stats for a device (defaults to the default device); available is false when unsupported. |
Public Functions Documentation¶
function Instance¶
Access the singleton hardware manager.
Return: Reference to the singleton HardwareManager.
Get the process-wide hardware manager.
function HardwareManager¶
function ~HardwareManager¶
Release the PJRT client and loaded plugin on teardown.
function HardwareManager¶
function operator=¶
function Initialize¶
Parameters:
- preferred_plugin_path Explicit plugin path, or auto-discovery when empty.
- preferred_plugin_path Optional explicit plugin path; discovered when empty.
Load a PJRT plugin and initialize its client. Load the PJRT plugin, create a client, and query its platform and devices.
function Shutdown¶
Tear down the client and unload the plugin.
function IsInitialized¶
Whether a PJRT client has been initialized.
function Api¶
Underlying PJRT API table.
function Client¶
Underlying PJRT client.
function PlatformName¶
Name of the loaded platform.
function PlatformVersion¶
Version of the loaded platform.
function LoadedPluginPath¶
Path of the loaded PJRT plugin.
function Devices¶
All discovered devices, in platform order.
function DefaultDevice¶
The default device used for execution.
Return: Handle to the default device.
First addressable device discovered by the plugin.
function Extension¶
Cached plugin extension of the given type, or nullptr when the plugin lacks it.
Drop the PJRT client, device list, and API pointer.
function MemoryStats¶
Memory stats for a device (defaults to the default device); available is false when unsupported.