Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[Benchmark App] Prioritize the config for device given in CLI when multiple are available (#26837)

Przemyslaw Wysocki9f52358ceac9
diff --git a/tools/benchmark_tool/openvino/tools/benchmark/main.py b/tools/benchmark_tool/openvino/tools/benchmark/main.py
index 0281debf32f..ad2839d217f 100644
--- a/tools/benchmark_tool/openvino/tools/benchmark/main.py
+++ b/tools/benchmark_tool/openvino/tools/benchmark/main.py
@@ -315,9 +315,13 @@ def main():
del device_number_streams[device]
device_config = {}
- for device in config:
- if benchmark.device.find(device) == 0:
- device_config = config[device]
+ # In case of multiple devices found prefer the one given in CLI argument
+ if benchmark.device.find(device_name) == 0 and device_name in config.keys():
+ device_config = config[device_name]
+ else:
+ for device in config:
+ if benchmark.device.find(device) == 0:
+ device_config = config[device]
if args.cache_dir:
benchmark.set_cache_dir(args.cache_dir)