VART-X  0.3.0
vart::Device Class Reference

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>

Public Member Functions

const std::shared_ptr< DeviceImplBase > & get_pimpl_handle () const
 get_pimpl_handle() - Retrieves pointer to Device implementation Base class. More...
 
int32_t get_device_index () const
 get_device_index() - Retrieves device index of current instance. More...
 
 Device ()=delete
 
 ~Device ()=default
 

Static Public Member Functions

static std::shared_ptr< Deviceget_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. More...
 

Detailed Description

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).

Constructor & Destructor Documentation

◆ Device()

vart::Device::Device ( )
delete

◆ ~Device()

vart::Device::~Device ( )
default

Member Function Documentation

◆ 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_idxDevice index on which XCLBIN is to be loaded. A non-negative value requires a non-empty xclbin_loc.
[in]xclbin_locXCLBIN 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 |
------------------------------------------------------------
Device()=delete

◆ 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

get_pimpl_handle() - Retrieves pointer to Device implementation Base class.

Returns
Constant reference to the implementation pointer. Non-null for any Device obtained via get_device_hdl().

The documentation for this class was generated from the following file: