Commit 90788696 authored by mbencer's avatar mbencer

Fixed cmake configuration in order to support onnx 1.5

parent 9242de3d
......@@ -30,6 +30,9 @@ set(ONNX_VERSION 1.5.0)
set(ONNX_GIT_REPO_URL https://github.com/onnx/onnx.git)
set(ONNX_GIT_BRANCH rel-${ONNX_VERSION})
add_definitions(-DONNX_BUILD_SHARED_LIBS=ON)
add_definitions(-DONNX_ML=ON)
ExternalProject_Add(
ext_onnx
PREFIX onnx
......@@ -58,8 +61,8 @@ ExternalProject_Add(
ExternalProject_Get_Property(ext_onnx SOURCE_DIR BINARY_DIR)
set(ONNX_INCLUDE_DIR ${SOURCE_DIR}/onnx)
set(ONNX_PROTO_INCLUDE_DIR ${BINARY_DIR}/onnx)
set(ONNX_INCLUDE_DIR ${SOURCE_DIR})
set(ONNX_PROTO_INCLUDE_DIR ${BINARY_DIR})
if (WIN32)
set(ONNX_LIBRARY ${BINARY_DIR}/${CMAKE_BUILD_TYPE}/onnx.lib)
set(ONNX_PROTO_LIBRARY ${BINARY_DIR}/${CMAKE_BUILD_TYPE}/onnx_proto.lib)
......
......@@ -16,7 +16,7 @@
#pragma once
#include <onnx-ml.pb.h>
#include <onnx/onnx_pb.h>
#include "ngraph/except.hpp"
#include "tensor.hpp"
......
......@@ -16,7 +16,7 @@
#pragma once
#include <onnx-ml.pb.h>
#include <onnx/onnx_pb.h>
#include <string>
#include <vector>
......
......@@ -14,7 +14,7 @@
// limitations under the License.
//*****************************************************************************
#include <onnx-ml.pb.h>
#include <onnx/onnx_pb.h>
#include "model.hpp"
#include "ngraph/log.hpp"
......
......@@ -16,7 +16,7 @@
#pragma once
#include <onnx-ml.pb.h>
#include <onnx/onnx_pb.h>
#include <ostream>
#include <string>
#include <unordered_map>
......
......@@ -14,7 +14,7 @@
// limitations under the License.
//*****************************************************************************
#include <onnx-ml.pb.h>
#include <onnx/onnx_pb.h>
#include "attribute.hpp"
#include "graph.hpp"
......
......@@ -16,7 +16,7 @@
#pragma once
#include <onnx-ml.pb.h>
#include <onnx/onnx_pb.h>
#include <utility>
#include <vector>
......@@ -115,6 +115,13 @@ namespace ngraph
auto it = reinterpret_cast<const T*>(raw_data.data());
return {it, it + (raw_data.size() / sizeof(T))};
}
template <typename T>
inline std::vector<T> __get_external_data(const std::string& raw_data)
{
auto it = reinterpret_cast<const T*>(raw_data.data());
return {it, it + (raw_data.size() / sizeof(T))};
}
}
}
......@@ -131,7 +138,11 @@ namespace ngraph
if (tensor.has_raw_data())
{
return detail::__get_raw_data<double>(tensor.raw_data());
}
} /*
else
{
return detail::__get_external_data(tensor.)
}*/
if (tensor.data_type() == onnx::TensorProto_DataType_DOUBLE)
{
return detail::__get_data<double>(tensor.double_data());
......
......@@ -16,7 +16,7 @@
#pragma once
#include <onnx-ml.pb.h>
#include <onnx/onnx_pb.h>
#include "ngraph/op/constant.hpp"
#include "ngraph/op/parameter.hpp"
......
......@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//*****************************************************************************
#include <onnx-ml.pb.h> // onnx types
#include <onnx/onnx_pb.h> // onnx types
#include "common.hpp"
......
......@@ -15,7 +15,7 @@
//*****************************************************************************
#include <cstdlib> // std::size_t, std::uintptr_t
#include <onnxifi.h>
#include <onnx/onnxifi.h>
#include <stdexcept> // std::invalid_agrument, std::out_of_rage
#include "backend.hpp"
......
......@@ -19,7 +19,7 @@
#include <cstddef> // std::size_t, std::uintptr_t
#include <map> // std::map
#include <mutex> // std::mutex
#include <onnxifi.h>
#include <onnx/onnxifi.h>
#include "backend.hpp"
#include "ngraph/runtime/backend.hpp"
......
......@@ -16,7 +16,7 @@
#pragma once
#include <onnxifi.h>
#include <onnx/onnxifi.h>
namespace ngraph
{
......
......@@ -16,7 +16,7 @@
#include <cstddef>
#include <cstdint>
#include <onnxifi.h>
#include <onnx/onnxifi.h>
#include <stdexcept>
#include "backend_manager.hpp"
......
......@@ -17,7 +17,7 @@
#pragma once
#include <memory>
#include <onnxifi.h>
#include <onnx/onnxifi.h>
#include "ngraph/runtime/backend.hpp"
#include "ngraph/runtime/tensor.hpp"
......
......@@ -17,7 +17,7 @@
#include <cstring>
#include <gtest/gtest.h>
#include <onnxifi.h>
#include <onnx/onnxifi.h>
#include "ngraph/runtime/backend_manager.hpp"
......
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