Metric#

oneAPI Level Zero Specification - Version 1.18.31

Metric Functions#

zetMetricGet#

Added in version 1.0

ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGet(zet_metric_group_handle_t hMetricGroup, uint32_t *pCount, zet_metric_handle_t *phMetrics)#

Retrieves metric from a metric group.

  • The application may call this function from simultaneous threads.

Parameters:
  • hMetricGroup – [in] handle of the metric group

  • pCount – [in,out] pointer to the number of metrics. if count is zero, then the driver shall update the value with the total number of metrics available. if count is greater than the number of metrics available, then the driver shall update the value with the correct number of metrics available.

  • phMetrics – [in,out][optional][range(0, *pCount)] array of handle of metrics. if count is less than the number of metrics available, then driver shall only retrieve that number of metrics.

Returns:

zetMetricGetProperties#

Added in version 1.0

ZE_APIEXPORT ze_result_t ZE_APICALL zetMetricGetProperties(zet_metric_handle_t hMetric, zet_metric_properties_t *pProperties)#

Retrieves attributes of a metric.

  • The application may call this function from simultaneous threads.

Parameters:
  • hMetric – [in] handle of the metric

  • pProperties – [in,out] metric properties

Returns:

Metric Enums#

zet_metric_type_t#

Added in version 1.0

enum zet_metric_type_t#

Metric types.

Values:

enumerator ZET_METRIC_TYPE_DURATION#

Metric type: duration.

enumerator ZET_METRIC_TYPE_EVENT#

Metric type: event.

enumerator ZET_METRIC_TYPE_EVENT_WITH_RANGE#

Metric type: event with range.

enumerator ZET_METRIC_TYPE_THROUGHPUT#

Metric type: throughput.

enumerator ZET_METRIC_TYPE_TIMESTAMP#

Metric type: timestamp.

enumerator ZET_METRIC_TYPE_FLAG#

Metric type: flag.

enumerator ZET_METRIC_TYPE_RATIO#

Metric type: ratio.

enumerator ZET_METRIC_TYPE_RAW#

Metric type: raw.

enumerator ZET_METRIC_TYPE_EVENT_EXP_TIMESTAMP#

Metric type: event with only timestamp and value has no meaning. (since v1.10)

enumerator ZET_METRIC_TYPE_EVENT_EXP_START#

Metric type: the first event of a start/end event pair. (since v1.10)

enumerator ZET_METRIC_TYPE_EVENT_EXP_END#

Metric type: the second event of a start/end event pair. (since v1.10)

enumerator ZET_METRIC_TYPE_EVENT_EXP_MONOTONIC_WRAPS_VALUE#

Metric type: value of the event is a monotonically increasing value that can wrap around (since v1.10)

enumerator ZET_METRIC_TYPE_EXP_EXPORT_DMA_BUF#

Metric which exports linux dma_buf, which could be imported/mapped to the host process (since v1.11)

enumerator ZET_METRIC_TYPE_IP_EXP#

Metric type: instruction pointer. Deprecated, use ZET_METRIC_TYPE_IP.

enumerator ZET_METRIC_TYPE_IP#

Metric type: instruction pointer. (since v1.7)

enumerator ZET_METRIC_TYPE_FORCE_UINT32#

Value marking end of ZET_METRIC_TYPE_* ENUMs.

Metric Structures#

zet_metric_properties_t#

Added in version 1.0

struct zet_metric_properties_t#

Metric properties queried using zetMetricGetProperties.

Public Members

zet_structure_type_t stype#

[in] type of this structure

void *pNext#

[in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).

char name[ZET_MAX_METRIC_NAME]#

[out] metric name

char description[ZET_MAX_METRIC_DESCRIPTION]#

[out] metric description

char component[ZET_MAX_METRIC_COMPONENT]#

[out] metric component

uint32_t tierNumber#

[out] number of tier

zet_metric_type_t metricType#

[out] metric type

zet_value_type_t resultType#

[out] metric result type

char resultUnits[ZET_MAX_METRIC_RESULT_UNITS]#

[out] metric result units