Skip to content

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

[intel-npu] Adding new usecase in getdevice logic for AUTO_DETECT (#30586)

Attila Csok22317263d3f0
diff --git a/src/plugins/intel_npu/src/backend/src/zero_backend.cpp b/src/plugins/intel_npu/src/backend/src/zero_backend.cpp
index 9e10963d9b6..1a40818c2ba 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_backend.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_backend.cpp
@@ -101,6 +101,14 @@ const std::shared_ptr<IDevice> ZeroEngineBackend::getDevice(const std::string& n
return it->second;
}
}
+ // if arch number is not found, we also try, one last time, for AUTO_DETECT devices too
+ // Devices with unpublished names will appear report AUTO_DETECT as id
+ // If we find any, we return it (the first one)
+ for (auto it = _devices.begin(); it != _devices.end(); ++it) {
+ if (it->second->getName() == "AUTO_DETECT") {
+ return it->second;
+ }
+ }
}
// if we got here, it means there is no device with that arch number