Class vart::Device#

class Device

This module manages the hardware context and loading of xclbin on to the device.

Please check API documentation for more information. Any module utilizing hardware acceleration requires an instance of the Device class.

Public Functions

const std::shared_ptr<DeviceImplBase> &get_pimpl_handle() const#

get_pimpl_handle() - Retrieves pointer to Device implementation Base class

Returns:

Returns a constant reference of pointer to implementation class.

int32_t get_device_index() const#

get_device_index() - Retrieves device index of current instance

Returns:

Returns the device index

Device() = delete#
~Device() = default#

Public Static Functions

static std::shared_ptr<Device> get_device_hdl(const int32_t dev_idx, const std::string &xclbin_loc)#

get_device_hdl() - Creates a Device() instance if not created earlier, else return an existing instance for given device index and xclbin.

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    | Returns error                      |
| new        | Exists | creates a new Device instance      |
------------------------------------------------------------
Parameters:
  • dev_idxDevice index on which XCLBIN is to be loaded.

  • xclbin_loc – XCLBIN path.

Returns:

Returns a Device pointer created using given dev_idx, xclbin_loc

Private Functions

Device(std::shared_ptr<DeviceImplBase> pimpl_hdl)#

Private Members

std::shared_ptr<DeviceImplBase> pimpl#