Skip to content

Commit

Permalink
Calculate blob hash only for LOG_LEVEL=LOG_INFO for `export_model…
Browse files Browse the repository at this point in the history
…` path
  • Loading branch information
MirceaDan99 committed Sep 24, 2024
1 parent 50bee10 commit ae2add9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/plugins/intel_npu/src/plugin/src/compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,17 @@ void CompiledModel::export_model(std::ostream& stream) const {
_logger.debug("CompiledModel::export_model");
const auto&& blob = _compiler->getCompiledNetwork(_networkPtr);
stream.write(reinterpret_cast<const char*>(blob.data()), blob.size());
std::stringstream str;
str << "Blob size: " << blob.size() << ", hash: " << std::hex << hash(blob);
_logger.info(str.str().c_str());

if (!stream) {
_logger.error("Write blob to stream failed. Blob is broken!");
} else {
_logger.info("Write blob to stream successfully.");
if (_logger.level() == ov::log::Level::INFO) {
std::stringstream str;
str << "Blob size: " << blob.size() << ", hash: " << std::hex << hash(blob);
_logger.info(str.str().c_str());

if (!stream) {
_logger.error("Write blob to stream failed. Blob is broken!");
} else {
_logger.info("Write blob to stream successfully.");
}
}
}

Expand Down

0 comments on commit ae2add9

Please sign in to comment.