Skip to content

Commit 358f360

Browse files
committed
Revert "Revert "Revert "Forcing the CiP path even if the compiler type was set to "DRIVER""""
This reverts commit ad4e1de.
1 parent c669a01 commit 358f360

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/plugins/intel_npu/src/plugin/src/plugin.cpp

+12-1
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,6 @@ std::unique_ptr<ICompilerAdapter> Plugin::getCompiler(const Config& config) cons
969969
_logger.debug("performing createCompiler");
970970

971971
switch (compilerType) {
972-
case ov::intel_npu::CompilerType::DRIVER:
973972
case ov::intel_npu::CompilerType::MLIR: {
974973
if (_backends->getBackendName() != "LEVEL0") {
975974
return std::make_unique<PluginCompilerAdapter>(nullptr);
@@ -982,6 +981,18 @@ std::unique_ptr<ICompilerAdapter> Plugin::getCompiler(const Config& config) cons
982981

983982
return std::make_unique<PluginCompilerAdapter>(zeroBackend->getInitStruct());
984983
}
984+
case ov::intel_npu::CompilerType::DRIVER: {
985+
if (_backends->getBackendName() != "LEVEL0") {
986+
OPENVINO_THROW("NPU Compiler Adapter must be used with LEVEL0 backend");
987+
}
988+
989+
auto zeroBackend = std::dynamic_pointer_cast<ZeroEngineBackend>(_backends->getIEngineBackend()._ptr);
990+
if (!zeroBackend) {
991+
OPENVINO_THROW("Failed to cast zeroBackend, zeroBackend is a nullptr");
992+
}
993+
994+
return std::make_unique<DriverCompilerAdapter>(zeroBackend->getInitStruct());
995+
}
985996
default:
986997
OPENVINO_THROW("Invalid NPU_COMPILER_TYPE");
987998
}

0 commit comments

Comments
 (0)