Skip to content

Commit a93f6fe

Browse files
committed
Use explicit blob release via .clear() + .shrink_to_fit() instead of moving it to unused function param
1 parent 22d676e commit a93f6fe

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ZeGraphExtWrappers final : public ZeGraphExtWrappersInterface {
7171

7272
void setGraphArgumentValue(ze_graph_handle_t graphHandle, uint32_t argi_, const void* argv) const override;
7373

74-
void initializeGraph(ze_graph_handle_t graphHandle, const Config& config, std::optional<std::vector<uint8_t>> /* unusedBlobOpt */) const override;
74+
void initializeGraph(ze_graph_handle_t graphHandle, const Config& config) const override;
7575

7676
private:
7777
template <ze_graph_ext_version_t T = TableExtension, std::enable_if_t<!NotSupportQuery(T), bool> = true>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ZeGraphExtWrappersInterface {
3434

3535
virtual void setGraphArgumentValue(ze_graph_handle_t graphHandle, uint32_t argi_, const void* argv) const = 0;
3636

37-
virtual void initializeGraph(ze_graph_handle_t graphHandle, const Config& config, std::optional<std::vector<uint8_t>> blobOpt) const = 0;
37+
virtual void initializeGraph(ze_graph_handle_t graphHandle, const Config& config) const = 0;
3838

3939
virtual ~ZeGraphExtWrappersInterface() = default;
4040
};

src/plugins/intel_npu/src/compiler_adapter/src/driver_graph.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ void DriverGraph::initialize(const Config& config) {
117117
set_workload_type(config.get<WORKLOAD_TYPE>());
118118
}
119119

120-
_zeGraphExt->initializeGraph(_handle, config, std::move(_blob));
120+
_zeGraphExt->initializeGraph(_handle, config);
121+
_blob.clear();
122+
_blob.shrink_to_fit();
121123

122124
_logger.debug("Graph initialize finish");
123125
}

src/plugins/intel_npu/src/compiler_adapter/src/plugin_graph.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ void PluginGraph::initialize(const Config& config) {
116116
set_workload_type(config.get<WORKLOAD_TYPE>());
117117
}
118118

119-
_zeGraphExt->initializeGraph(_handle, config, std::move(_blob));
119+
_zeGraphExt->initializeGraph(_handle, config);
120+
_blob.clear();
121+
_blob.shrink_to_fit();
120122

121123
_logger.debug("Graph initialize finish");
122124
}

src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void ZeGraphExtWrappers<TableExtension>::setGraphArgumentValue(ze_graph_handle_t
145145
}
146146

147147
template <ze_graph_ext_version_t TableExtension>
148-
void ZeGraphExtWrappers<TableExtension>::initializeGraph(ze_graph_handle_t graphHandle, const Config& config, std::optional<std::vector<uint8_t>> /* unusedBlob */) const {
148+
void ZeGraphExtWrappers<TableExtension>::initializeGraph(ze_graph_handle_t graphHandle, const Config& config) const {
149149
if (_zeroInitStruct->getGraphDdiTable().version() < ZE_GRAPH_EXT_VERSION_1_8) {
150150
initialize_graph_through_command_list(graphHandle, config);
151151
} else {

0 commit comments

Comments
 (0)