Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions modules/nvidia_plugin/src/cuda_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "openvino/runtime/internal_properties.hpp"
#include "openvino/runtime/core.hpp"
#include "openvino/runtime/properties.hpp"
#include "openvino/runtime/shared_buffer.hpp"
#include "openvino/runtime/threading/executor_manager.hpp"
#include "transformations/rt_info/fused_names_attribute.hpp"

Expand Down Expand Up @@ -76,6 +77,20 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
return compiled_model;
}

std::shared_ptr<ov::ICompiledModel> Plugin::import_model(const ov::Tensor& model, const ov::AnyMap& properties) const {
ov::SharedStreamBuffer buffer{reinterpret_cast<char*>(model.data()), model.get_byte_size()};
std::istream stream{&buffer};
return import_model(stream, properties);
};

std::shared_ptr<ov::ICompiledModel> Plugin::import_model(const ov::Tensor& model,
const ov::SoPtr<ov::IRemoteContext>& context,
const ov::AnyMap& properties) const {
ov::SharedStreamBuffer buffer{reinterpret_cast<char*>(model.data()), model.get_byte_size()};
std::istream stream{&buffer};
return import_model(stream, context, properties);
};

std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& model_stream,
const ov::AnyMap& properties) const {
return import_model(model_stream, {}, properties);
Expand Down
7 changes: 7 additions & 0 deletions modules/nvidia_plugin/src/cuda_plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ class Plugin : public ov::IPlugin {
const ov::SoPtr<ov::IRemoteContext>& context,
const ov::AnyMap& properties) const override;

std::shared_ptr<ov::ICompiledModel> import_model(const ov::Tensor& model_stream,
const ov::AnyMap& properties) const override;

std::shared_ptr<ov::ICompiledModel> import_model(const ov::Tensor& model_stream,
const ov::SoPtr<ov::IRemoteContext>& context,
const ov::AnyMap& properties) const override;

ov::SupportedOpsMap query_model(const std::shared_ptr<const ov::Model>& model,
const ov::AnyMap& properties) const override;

Expand Down
Loading