Manages the hardware context and loading of xclbin onto the device. Any module utilizing hardware acceleration requires a Device instance. Instances are not constructed directly; use the static factory get_device_hdl(), which caches results per (dev_idx, xclbin_loc).
More...
#include <vart_device.hpp>
Manages the hardware context and loading of xclbin onto the device. Any module utilizing hardware acceleration requires a Device instance. Instances are not constructed directly; use the static factory get_device_hdl(), which caches results per (dev_idx, xclbin_loc).
◆ Device()
◆ ~Device()
| vart::Device::~Device |
( |
| ) |
|
|
default |
◆ get_device_hdl()
| static std::shared_ptr<Device> vart::Device::get_device_hdl |
( |
const int32_t |
dev_idx, |
|
|
const std::string & |
xclbin_loc |
|
) |
| |
|
static |
get_device_hdl() - Creates a Device() instance if not created earlier, else return an existing instance for given device index and xclbin.
- Parameters
-
| [in] | dev_idx | Device index on which XCLBIN is to be loaded. A non-negative value requires a non-empty xclbin_loc. |
| [in] | xclbin_loc | XCLBIN path. Must be non-empty when dev_idx is non-negative. |
- Returns
- Returns a Device pointer created using given dev_idx, xclbin_loc
The following criteria is the basis for either to create a new Device instance or not:
------------------------------------------------------------
| dev_idx | xclbin | Result |
------------------------------------------------------------
| Exists | Exists | Returns an existing
Device instance|
|
new |
new | creates a
new Device instance |
| Exists | new | Throws std::runtime_error |
|
new | Exists | creates a
new Device instance |
------------------------------------------------------------
◆ get_device_index()
| int32_t vart::Device::get_device_index |
( |
| ) |
const |
get_device_index() - Retrieves device index of current instance.
- Returns
- Returns the device index
◆ get_pimpl_handle()
| const std::shared_ptr<DeviceImplBase>& vart::Device::get_pimpl_handle |
( |
| ) |
const |
The documentation for this class was generated from the following file: