Skip to content

Commit 2ede306

Browse files
authored
Add overrides to new plugin methods (#982)
1 parent bc968f5 commit 2ede306

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

modules/nvidia_plugin/src/cuda_plugin.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "openvino/runtime/internal_properties.hpp"
1515
#include "openvino/runtime/core.hpp"
1616
#include "openvino/runtime/properties.hpp"
17+
#include "openvino/runtime/shared_buffer.hpp"
1718
#include "openvino/runtime/threading/executor_manager.hpp"
1819
#include "transformations/rt_info/fused_names_attribute.hpp"
1920

@@ -76,6 +77,20 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
7677
return compiled_model;
7778
}
7879

80+
std::shared_ptr<ov::ICompiledModel> Plugin::import_model(const ov::Tensor& model, const ov::AnyMap& properties) const {
81+
ov::SharedStreamBuffer buffer{reinterpret_cast<char*>(model.data()), model.get_byte_size()};
82+
std::istream stream{&buffer};
83+
return import_model(stream, properties);
84+
};
85+
86+
std::shared_ptr<ov::ICompiledModel> Plugin::import_model(const ov::Tensor& model,
87+
const ov::SoPtr<ov::IRemoteContext>& context,
88+
const ov::AnyMap& properties) const {
89+
ov::SharedStreamBuffer buffer{reinterpret_cast<char*>(model.data()), model.get_byte_size()};
90+
std::istream stream{&buffer};
91+
return import_model(stream, context, properties);
92+
};
93+
7994
std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& model_stream,
8095
const ov::AnyMap& properties) const {
8196
return import_model(model_stream, {}, properties);

modules/nvidia_plugin/src/cuda_plugin.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ class Plugin : public ov::IPlugin {
4040
const ov::SoPtr<ov::IRemoteContext>& context,
4141
const ov::AnyMap& properties) const override;
4242

43+
std::shared_ptr<ov::ICompiledModel> import_model(const ov::Tensor& model_stream,
44+
const ov::AnyMap& properties) const override;
45+
46+
std::shared_ptr<ov::ICompiledModel> import_model(const ov::Tensor& model_stream,
47+
const ov::SoPtr<ov::IRemoteContext>& context,
48+
const ov::AnyMap& properties) const override;
49+
4350
ov::SupportedOpsMap query_model(const std::shared_ptr<const ov::Model>& model,
4451
const ov::AnyMap& properties) const override;
4552

0 commit comments

Comments
 (0)