Metric Source ID Support Extension#
Introduced in Level Zero version 1.13
API#
Structures
Metric Source ID#
Devices can include more than one HW architecture for profiling. Each individual profiling architecture can generate separate metrics data and can behave as individual Metric Source. The Metric Sources can be identified by an unique ID that can be retrieved using zet_metric_source_id_exp_t. Metrics in a metric group are associated with the same specific Metric Source. Therefore, the property is queried from the metric group.
Sample Code#
The following pseudo-code demonstrates how Metric source ID can be retrieved.
// 1. Select the metric group for the metrics to be collected using zetMetricGroupGet // 2. Identify sourceId of the selected metric in the metric group zet_metric_source_id_exp_t metricGroupSourceId{}; metricGroupSourceId.stype = ZET_STRUCTURE_TYPE_METRIC_SOURCE_ID_EXP; metricGroupSourceId.pNext = nullptr; zet_metric_group_properties_t metricGroupProperties; metricGroupProperties.stype = ZET_STRUCTURE_TYPE_METRIC_GROUP_PROPERTIES; metricGroupProperties.pNext = &metricGroupSourceId; // Get the SourceId from the metricGroupProperties zetMetricGroupGetProperties(hInterestedMetricGroup, &metricGroupProperties); uint32_t metricSourceId = metricGroupSourceId.sourceId;