OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[NPU] Metadata change that should fix the windows debug run (#32585)
Razvan Apetroaie66fd71c20271
diff --git a/src/plugins/intel_npu/src/plugin/src/metadata.cpp b/src/plugins/intel_npu/src/plugin/src/metadata.cppindex d1e5c297695..ec458e0aab5 100644--- a/src/plugins/intel_npu/src/plugin/src/metadata.cpp+++ b/src/plugins/intel_npu/src/plugin/src/metadata.cpp@@ -107,17 +107,16 @@ void MetadataBase::read(const ov::Tensor& tensor) {}void MetadataBase::read_data_from_source(char* destination, const size_t size) {- ov::util::VariantVisitor reader{[&](std::reference_wrapper<std::istream> stream) {- stream.get().read(destination, size);- },- [&](std::reference_wrapper<const ov::Tensor> tensor) {- std::memcpy(destination, tensor.get().data<const char>() + _cursorOffset, size);- _cursorOffset += size;- },- [&](uninitialized_source) {- OPENVINO_THROW("No blob has been provided to NPU plugin's metadata reader.");- }};- std::visit(reader, _source);+ if (const std::reference_wrapper<std::istream>* stream =+ std::get_if<std::reference_wrapper<std::istream>>(&_source)) {+ stream->get().read(destination, size);+ } else if (const std::reference_wrapper<const ov::Tensor>* tensor =+ std::get_if<std::reference_wrapper<const ov::Tensor>>(&_source)) {+ std::memcpy(destination, tensor->get().data<const char>() + _cursorOffset, size);+ _cursorOffset += size;+ } else {+ OPENVINO_THROW("No blob has been provided to NPU plugin's metadata reader.");+ }}void MetadataBase::append_padding_blob_size_and_magic(std::ostream& stream) {