Commit 0a11fa24 authored by Robert Kimball's avatar Robert Kimball

update onnxifi

parent 8214cd39
......@@ -47,26 +47,11 @@ namespace ngraph
}
const std::string& get_type() const { return m_type; }
runtime::Handle compile(const std::shared_ptr<Function>& function) const
std::shared_ptr<ngraph::runtime::Executable> compile(const std::shared_ptr<Function>& function) const
{
return get().compile(function);
}
bool call(const std::shared_ptr<Function>& function,
const std::vector<std::shared_ptr<runtime::Tensor>>& outputs,
const std::vector<std::shared_ptr<runtime::Tensor>>& inputs) const
{
return get().call(function, outputs, inputs);
}
bool call_with_validate(
const std::shared_ptr<Function>& function,
const std::vector<std::shared_ptr<runtime::Tensor>>& outputs,
const std::vector<std::shared_ptr<runtime::Tensor>>& inputs) const
{
return get().call_with_validate(function, outputs, inputs);
}
private:
std::string m_type{};
mutable std::shared_ptr<runtime::Backend> m_backend{nullptr};
......@@ -81,6 +66,38 @@ namespace ngraph
}
};
/// \brief ONNXIFI extensions to nGraph Executable
class Executable
{
public:
Executable(const Executable&) = delete;
Executable& operator=(const Executable&) = delete;
Executable(Executable&&) = default;
Executable& operator=(Executable&&) = default;
explicit Executable(const std::shared_ptr<runtime::Executable>& executable)
: m_executable{executable}
{
}
bool call(const std::vector<std::shared_ptr<runtime::Tensor>>& outputs,
const std::vector<std::shared_ptr<runtime::Tensor>>& inputs) const
{
return m_executable->call(outputs, inputs);
}
bool call_with_validate(
const std::vector<std::shared_ptr<runtime::Tensor>>& outputs,
const std::vector<std::shared_ptr<runtime::Tensor>>& inputs) const
{
return m_executable->call_with_validate(outputs, inputs);
}
private:
mutable std::shared_ptr<runtime::Executable> m_executable{nullptr};
};
} // namespace onnxifi
} // namespace ngraph
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment