Skip to content

Commit

Permalink
[NPU] fix segfault in compile_tool (#28434)
Browse files Browse the repository at this point in the history
### Details:
- Fix `Segmentation fault (core dumped)` issue when running
`compile_tool` without a device.
 
### Tickets:
 - *E151581*
  • Loading branch information
DanLiu2Intel authored Jan 15, 2025
1 parent 3caf7b2 commit ca38e56
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ class CompilerAdapterFactory final {
auto compilerType = config.get<COMPILER_TYPE>();
switch (compilerType) {
case ov::intel_npu::CompilerType::MLIR: {
if (engineBackend->getName() != "LEVEL0") {
if (engineBackend == nullptr || engineBackend->getName() != "LEVEL0") {
return std::make_unique<PluginCompilerAdapter>(nullptr);
}

return std::make_unique<PluginCompilerAdapter>(engineBackend->getInitStructs());
}
case ov::intel_npu::CompilerType::DRIVER: {
if (engineBackend->getName() != "LEVEL0") {
if (engineBackend == nullptr || engineBackend->getName() != "LEVEL0") {
OPENVINO_THROW("NPU Compiler Adapter must be used with LEVEL0 backend");
}

Expand Down

0 comments on commit ca38e56

Please sign in to comment.