Commit f1177913 authored by Robert Kimball's avatar Robert Kimball

fix build

parent 624da449
...@@ -35,7 +35,7 @@ void regclass_pyngraph_runtime_Backend(py::module m) ...@@ -35,7 +35,7 @@ void regclass_pyngraph_runtime_Backend(py::module m)
const ngraph::element::Type&, const ngraph::Shape&)) & const ngraph::element::Type&, const ngraph::Shape&)) &
ngraph::runtime::Backend::create_tensor); ngraph::runtime::Backend::create_tensor);
backend.def("compile", backend.def("compile",
(std::unique_ptr<ngraph::runtime::Executable>(ngraph::runtime::Backend::*)( (std::shared_ptr<ngraph::runtime::Executable>(ngraph::runtime::Backend::*)(
std::shared_ptr<ngraph::Function>, bool)) & std::shared_ptr<ngraph::Function>)) &
ngraph::runtime::Backend::compile); ngraph::runtime::Backend::compile);
} }
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <pybind11/pybind11.h> #include <pybind11/pybind11.h>
#include "pyngraph/runtime/backend.hpp" #include "pyngraph/runtime/backend.hpp"
#include "pyngraph/runtime/executable.hpp"
#include "pyngraph/runtime/tensor.hpp" #include "pyngraph/runtime/tensor.hpp"
namespace py = pybind11; namespace py = pybind11;
......
...@@ -47,7 +47,8 @@ namespace ngraph ...@@ -47,7 +47,8 @@ namespace ngraph
} }
const std::string& get_type() const { return m_type; } const std::string& get_type() const { return m_type; }
std::shared_ptr<ngraph::runtime::Executable> compile(const std::shared_ptr<Function>& function) const std::shared_ptr<runtime::Executable>
compile(const std::shared_ptr<Function>& function) const
{ {
return get().compile(function); return get().compile(function);
} }
...@@ -66,38 +67,6 @@ namespace ngraph ...@@ -66,38 +67,6 @@ 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 onnxifi
} // namespace ngraph } // namespace ngraph
//*****************************************************************************
// Copyright 2017-2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#pragma once
#include <memory> // std::shared_ptr
#include <string> // std::string
#include <utility> // std::move
#include <vector> // std::vector
#include "ngraph/function.hpp"
#include "ngraph/runtime/backend.hpp"
#include "ngraph/runtime/executable.hpp"
#include "ngraph/runtime/tensor.hpp"
namespace ngraph
{
namespace onnxifi
{
/// \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
...@@ -49,7 +49,7 @@ namespace ngraph ...@@ -49,7 +49,7 @@ namespace ngraph
compile(std::shared_ptr<Function> func, compile(std::shared_ptr<Function> func,
bool enable_performance_counters = false) override; bool enable_performance_counters = false) override;
void remove_compiled_function(shared_ptr<Executable> exec) override; void remove_compiled_function(std::shared_ptr<Executable> exec) override;
bool is_supported(const Node& node) const override; bool is_supported(const Node& node) const override;
bool is_supported_property(const Property prop) const override; bool is_supported_property(const Property prop) const override;
......
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