Q.ANT Native Computing Toolkit 2.3.1
All you need for photonic computing
Loading...
Searching...
No Matches
qant_native_computing_toolkit_info.h File Reference
#include <stddef.h>
#include <stdint.h>
Include dependency graph for qant_native_computing_toolkit_info.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  QantSensorInfo
struct  QantVersionInfo
struct  QantPerformanceCounterInfo
 Struct to hold performance counter information. More...

Macros

#define QANT_NATIVE_COMPUTING_TOOLKIT_MAJOR_VERSION   2
#define QANT_NATIVE_COMPUTING_TOOLKIT_MINOR_VERSION   3
#define QANT_NATIVE_COMPUTING_TOOLKIT_DEFAULT_CHAR_ARR_LENGTH   1024

Functions

int setup_logging (char const *folder_name, int const loglevel)
 Enables logging.
int get_driver_info (const uint32_t npu_id, char *output, size_t len)
 Gets detailed information about the Q.ANT native computing driver and its direct dependencies.
QantSensorInfo get_sensor_info (const uint32_t npu_id)
 Get detailed information about the NPU sensors, e.g. temperature.
QantVersionInfo get_version_info (const uint32_t npu_id)
 Gets information about the firmware versions.
int get_available_npus (uint32_t *idxs_out, char(*serials_out)[QANT_NATIVE_COMPUTING_TOOLKIT_DEFAULT_CHAR_ARR_LENGTH], size_t capacity, size_t *out_count)
 Get all available NPUs.
int reset_perf_counter (const uint32_t npu_id)
 Reset the performance counters.
int get_perf_counter (const uint32_t npu_id, QantPerformanceCounterInfo *out)
 Gets the performance counters.

Macro Definition Documentation

◆ QANT_NATIVE_COMPUTING_TOOLKIT_DEFAULT_CHAR_ARR_LENGTH

#define QANT_NATIVE_COMPUTING_TOOLKIT_DEFAULT_CHAR_ARR_LENGTH   1024

◆ QANT_NATIVE_COMPUTING_TOOLKIT_MAJOR_VERSION

#define QANT_NATIVE_COMPUTING_TOOLKIT_MAJOR_VERSION   2

◆ QANT_NATIVE_COMPUTING_TOOLKIT_MINOR_VERSION

#define QANT_NATIVE_COMPUTING_TOOLKIT_MINOR_VERSION   3

Function Documentation

◆ get_available_npus()

int get_available_npus ( uint32_t * idxs_out,
char(*) serials_out[QANT_NATIVE_COMPUTING_TOOLKIT_DEFAULT_CHAR_ARR_LENGTH],
size_t capacity,
size_t * out_count )

Get all available NPUs.

Parameters
idxs_outArray to place the (pcie-enumeration) idxs of the available NPUs, length: capacity.
serials_outArray to place the NPU serial numbers, length: capacity.
capacityLength of idxs_out, serials_out. Should be chosen at least as large as the expected number of available NPUs.
out_countThe actual number of available NPUs.
Returns
0 if successful, and a negative error code in case of failure.

◆ get_driver_info()

int get_driver_info ( const uint32_t npu_id,
char * output,
size_t len )

Gets detailed information about the Q.ANT native computing driver and its direct dependencies.

Parameters
npu_idThe identifier of the NPU on which to perform the operation.
outputA preallocated memory to store the info string into.
lenThe maximum length of the string.
Returns
0 if successful, negative error code otherwise.

◆ get_perf_counter()

int get_perf_counter ( const uint32_t npu_id,
QantPerformanceCounterInfo * out )

Gets the performance counters.

Parameters
npu_idThe identifier of the NPU on which to perform the operation.
outA preallocated memory to store the counter info.
Returns
0 if successful, a non-zero code otherwise.

◆ get_sensor_info()

QantSensorInfo get_sensor_info ( const uint32_t npu_id)

Get detailed information about the NPU sensors, e.g. temperature.

Parameters
npu_idThe identifier of the NPU on which to perform the operation.
Returns
The sensor information as a struct.

◆ get_version_info()

QantVersionInfo get_version_info ( const uint32_t npu_id)

Gets information about the firmware versions.

Parameters
npu_idThe identifier of the NPU on which to perform the operation.
Returns
The version information as a struct.

◆ reset_perf_counter()

int reset_perf_counter ( const uint32_t npu_id)

Reset the performance counters.

Parameters
npu_idThe identifier of the NPU on which to perform the operation.
Returns
0 if successful, and a negative error code in case of failure.

◆ setup_logging()

int setup_logging ( char const * folder_name,
int const loglevel )

Enables logging.

Log messages are written to stdout and to a file

Parameters
folder_nameThe folder where the log files are created. Individual logfiles are created with a timestamp.
loglevelThe logging level, from 0 = tracing to 4 = error only.
Returns
0 if successful, error code otherwise