mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
refactor: add support to query root device metric
Related-To: NEO-11046 Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
54e07def28
commit
0dc297cdc3
@@ -148,10 +148,12 @@ struct MetricImp : public Metric {
|
||||
~MetricImp() override = default;
|
||||
MetricImp(MetricSource &metricSource) : metricSource(metricSource) {}
|
||||
bool isImmutable() { return isPredefined; }
|
||||
bool isRootDevice() { return isMultiDevice; }
|
||||
|
||||
protected:
|
||||
MetricSource &metricSource;
|
||||
bool isPredefined = true;
|
||||
bool isMultiDevice = false;
|
||||
};
|
||||
|
||||
struct MetricGroup : _zet_metric_group_handle_t {
|
||||
|
||||
@@ -122,6 +122,10 @@ class MockMetric : public L0::MetricImp {
|
||||
void setPredefined(bool status) {
|
||||
isPredefined = status;
|
||||
}
|
||||
|
||||
void setMultiDevice(bool status) {
|
||||
isMultiDevice = status;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace ult
|
||||
|
||||
@@ -118,5 +118,11 @@ TEST_F(MetricEnumerationProgrammableTest, whenProgrammableApisAreCalledUnsupport
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, zetMetricCreateFromProgrammableExp(hMetricProgrammable, ¶meterValues, parameterCount, metricName, metricDescription, &metricHandleCount, nullptr));
|
||||
}
|
||||
|
||||
TEST_F(MetricEnumerationProgrammableTest, givenNonRootDeviceMetricwhenIsRootDeviceIsCalledThenReturnFalse) {
|
||||
MockMetricSource metricSource{};
|
||||
MockMetric metric(metricSource);
|
||||
EXPECT_FALSE(metric.isRootDevice());
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
||||
|
||||
Reference in New Issue
Block a user