Skip to content

Commit 7bb58a7

Browse files
committed
fix comments2
1 parent 24e2935 commit 7bb58a7

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

src/plugins/intel_npu/src/compiler_adapter/include/compiler.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//
2-
// Copyright (C) 2023 Intel Corporation.
3-
// SPDX-License-Identifier: Apache 2.0
1+
// Copyright (C) 2018-2025 Intel Corporation
2+
// SPDX-License-Identifier: Apache-2.0
43
//
54

65
#ifndef VPUX_COMPILER_L0_H

src/plugins/intel_npu/src/compiler_adapter/include/compiler_impl.hpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#pragma once
66

77
#include <memory>
8+
#include <mutex>
89

910
#include "compiler.h"
1011
#include "intel_npu/common/filtered_config.hpp"
@@ -23,7 +24,15 @@ class VCLCompilerImpl final : public intel_npu::ICompiler {
2324
~VCLCompilerImpl() override;
2425

2526
static std::shared_ptr<VCLCompilerImpl> getInstance() {
26-
static std::shared_ptr<VCLCompilerImpl> compiler = std::make_shared<VCLCompilerImpl>();
27+
static std::mutex mutex;
28+
static std::weak_ptr<VCLCompilerImpl> weak_compiler;
29+
30+
std::lock_guard<std::mutex> lock(mutex);
31+
auto compiler = weak_compiler.lock();
32+
if (!compiler) {
33+
compiler = std::make_shared<VCLCompilerImpl>();
34+
weak_compiler = compiler;
35+
}
2736
return compiler;
2837
}
2938

src/plugins/intel_npu/src/compiler_adapter/src/graph.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ void Graph::set_argument_value(uint32_t argi, const void* argv) const {
157157
}
158158

159159
void Graph::initialize(const Config& config) {
160-
if (!_zeroInitStruct) {
161-
_logger.warning("_zeroInitStruct is nullptr!");
162-
return;
163-
}
164160
_logger.debug("Graph initialize start");
165161

166162
if (_zeGraphExt == nullptr || _graphDesc._handle == nullptr) {

src/plugins/intel_npu/src/compiler_adapter/src/plugin_compiler_adapter.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,16 @@ std::shared_ptr<IGraph> PluginCompilerAdapter::compile(const std::shared_ptr<con
140140
graphDesc = _zeGraphExt->getGraphDescriptor(tensor.data(), tensor.get_byte_size());
141141
networkMeta = _zeGraphExt->getNetworkMeta(graphDesc);
142142
networkMeta.name = model->get_friendly_name();
143+
} catch (const std::exception& ex) {
144+
_logger.info("Failed to use the level zero graph handle: %s. Inference requests for this model are not "
145+
"allowed. Only exports are available",
146+
ex.what());
143147
} catch (...) {
144148
_logger.info("Failed to obtain the level zero graph handle. Inference requests for this model are not "
145149
"allowed. Only exports are available");
146150
}
147151
} else {
148-
_logger.warning("no zeGraphExt, metadata is empty from vcl compiler");
152+
_logger.warning("No driver is found, zeGraphExt is nullptr, so metadata is empty. Only exports are available");
149153
}
150154

151155
return std::make_shared<Graph>(

src/plugins/intel_npu/src/compiler_adapter/src/weightless_utils.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// SPDX-License-Identifier: Apache-2.0
33
//
44

5-
#pragma once
6-
75
#include "weightless_utils.hpp"
86

97
#include "openvino/core/rt_info/weightless_caching_attributes.hpp"

0 commit comments

Comments
 (0)