class Util¶
Help on class Util in module qaicrt:
Utility class to get information on the AIC device. Supports basic operations on device such as getting device ID, device information, resource information, and so on.
Util()¶
Util() -> util
Creates and returns a new util object.
Methods defined here:
init¶
checkLibraryVersion¶
Description:
Checks Library Version with AicApi header.
- Major library version should be equal to LRT_LIB_MAJOR_VERSION.
- Minor library version should be less than LRT_LIB_MINOR_VERSION.
Returns:
- qaicrt.QStatus.QS_SUCCESSSuccessful completion
- qaicrt.QStatus.QS_ERRORDriver init failed
getAicVersion¶
Description:
Gets Aic version of the library.
Returns:
Tuple of operational status, major, minor, patch, variant
- Operational status:- qaicrt.QStatus.QS_SUCCESSSuccessful completion
- qaicrt.QStatus.QS_INVALInternal error in getting aic version
 
- major: Major version of the library
- minor: Minor version of the library
- patch: Patch being used by the library
- variant: Variant of the library being used
getDeviceIds¶
getDeviceIds(self: qaicrt.Util, deviceType: qaicrt.QAicDeviceType = <QAicDeviceType.QAIC_DEVICE_TYPE_DEFAULT: 1>) -> Tuple[qaicrt.QStatus, qaicrt.QIDList]
Description
Get the list of AIC devices. Optional argument deviceType specifies the type of the device.
Parameters
| Parameter | Description | 
|---|---|
| deviceType | [Optional] Type of device | 
Returns
Tuple of operational status and the list of AIC devices.
- Operational Status: - qaicrt.QStatus.QS_SUCCESSSuccessful completion
- qaicrt.QStatus.QS_INVALInternal error in getting device list
- qaicrt.QStatus.QS_NODEVNo valid device
- qaicrt.QStatus.QS_ERRORDriver init failed or Bad device AddrInfo
 
getDeviceInfo¶
DescriptionGet device information for the device specified.
Parameters
| Parameter | Description | 
|---|---|
| devID | A valid device ID returned from getDeviceIds() | 
Returns
Tuple of operational status and Device info.
- Operational Status: - qaicrt.QStatus.QS_SUCCESSSuccessful completion
- qaicrt.QStatus.QS_INVALInternal error in getting device info
- qaicrt.QStatus.QS_NODEVNo valid device
- qaicrt.QStatus.QS_ERRORDriver init failed
- qaicrt.QStatus.QS_AGAINError on reload Device Id
 
getPerformanceInfo¶
DescriptionGet device performance information, this is a simple query that returns performance info. Note the same information is availablethrough GetDeviceInfo, however this is a more lightweight ap allowing to retrieve only the performance info.
Parameters
| Parameter | Description | 
|---|---|
| devID | A valid device ID returned from getDeviceIds() | 
Returns
Tuple of operational status and Performance info.
- Operational Status: - qaicrt.QStatus.QS_SUCCESSSuccessful completion
- qaicrt.QStatus.QS_INVALInternal error in getting performance info
- qaicrt.QStatus.QS_NODEVDevice not found, the device ID provided is not available
- qaicrt.QStatus.QS_ERRORDriver init failed
- qaicrt.QStatus.QS_DEV_ERRORDevice validity error
 
getResourceInfo¶
Description
Get device performance information. This is a simple query that returns status of dynamic resources such as free memory, etc..Note that the same information is available through GetDeviceInfo,however this is a more lightweight api allowing to retrieve only the resourceinfo.
Parameters
| Parameter | Description | 
|---|---|
| devID | A valid device ID returned from getDeviceIds() | 
Returns
Tuple of operational status and Resource info.
- Operational Status: - qaicrt.QStatus.QS_SUCCESSSuccessful completion
- qaicrt.QStatus.QS_INVALInternal error in getting resource info
- qaicrt.QStatus.QS_NODEVDevice not found, the device ID provided is not available
- qaicrt.QStatus.QS_ERRORDriver init failed
- qaicrt.QStatus.QS_DEV_ERRORDevice validity error
 
lockDevice¶
Description
Lock a device for exclusive access. This is an advisory lock, so if an uncooperative app accesses a locked device the operations are not blocked. This functionality is enabled by setting env var QAIC_SERIALIZE_DEVICE to 1.If the env var is unset, the call returns QS_UNSUPPORTED.
Parameters
| Parameter | Description | 
|---|---|
| devID | A valid device ID returned from getDeviceIds() | 
| lock | locks or unlocks the device | 
| block | Blocking or non-blocking. No-op if lock is false. | 
Returns
Operational Status.
- Operational Status- qaicrt.QStatus.QS_SUCCESSSuccessful completion
- qaicrt.QStatus.QS_NODEVDevice not found
- qaicrt.QStatus.QS_ERRORDriver init failed
- qaicrt.QStatus.QS_UNSUPPORTEDEnv var for advisory lock not set
- qaicrt.QStatus.QS_BUSYDevice locked