aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2021-02-03 10:43:04 +0000
committerFrancis Murtagh <francis.murtagh@arm.com>2021-02-08 16:25:54 +0000
commitac001eebca101f2df4973d2f1d8cfca026e07419 (patch)
treed8f3b0203a279e777fd27fd33a50282cd5adbc0f
parentd92a6e4c19567cb03de76963068c002353cea528 (diff)
downloadarmnn-ac001eebca101f2df4973d2f1d8cfca026e07419.tar.gz
IVGCVSW-4901 Add semantic versioning to Parsers and TfLite Delegate
* Added Version.hpp to all Parsers * Added Version.hpp to TfLite Delegate * Updated CMakeLists to use new versions * Added GetVersion method to parsers and TfLite Delegate Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: If29e1e6d9e615f9095ec1c01ad47acfff40b1dd5
-rw-r--r--CMakeLists.txt11
-rw-r--r--cmake/DelegateVersion.cmake18
-rw-r--r--cmake/ParserVersion.cmake67
-rw-r--r--delegate/CMakeLists.txt3
-rw-r--r--delegate/include/Version.hpp29
-rw-r--r--delegate/include/armnn_delegate.hpp3
-rw-r--r--delegate/src/armnn_delegate.cpp8
-rw-r--r--include/armnnCaffeParser/Version.hpp29
-rw-r--r--include/armnnOnnxParser/Version.hpp29
-rw-r--r--include/armnnTfLiteParser/Version.hpp29
-rw-r--r--include/armnnTfParser/Version.hpp29
-rw-r--r--src/armnnCaffeParser/CaffeParser.cpp8
-rw-r--r--src/armnnCaffeParser/CaffeParser.hpp3
-rw-r--r--src/armnnOnnxParser/OnnxParser.cpp8
-rw-r--r--src/armnnOnnxParser/OnnxParser.hpp3
-rwxr-xr-xsrc/armnnTfLiteParser/CMakeLists.txt3
-rw-r--r--src/armnnTfLiteParser/TfLiteParser.cpp10
-rw-r--r--src/armnnTfLiteParser/TfLiteParser.hpp3
-rwxr-xr-xsrc/armnnTfParser/TfParser.cpp8
-rw-r--r--src/armnnTfParser/TfParser.hpp3
20 files changed, 299 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2b6e90064..0a71de7b5b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,8 @@ project(armnn)
set(additional_cmake_files)
list(APPEND additional_cmake_files
cmake/ArmnnVersion.cmake
+ cmake/DelegateVersion.cmake
+ cmake/ParserVersion.cmake
cmake/Utils.cmake
cmake/GlobalConfig.cmake
cmake/AddDllCopyCommands.cmake)
@@ -102,6 +104,7 @@ if(BUILD_CAFFE_PARSER)
set(armnn_caffe_parser_sources)
list(APPEND armnn_caffe_parser_sources
include/armnnCaffeParser/ICaffeParser.hpp
+ include/armnnCaffeParser/Version.hpp
src/armnnCaffeParser/RecordByRecordCaffeParser.hpp
src/armnnCaffeParser/RecordByRecordCaffeParser.cpp
src/armnnCaffeParser/CaffeParser.hpp
@@ -120,7 +123,7 @@ if(BUILD_CAFFE_PARSER)
target_link_libraries(armnnCaffeParser armnn)
target_link_libraries(armnnCaffeParser ${PROTOBUF_LIBRARIES})
- set_target_properties(armnnCaffeParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
+ set_target_properties(armnnCaffeParser PROPERTIES VERSION ${CAFFE_PARSER_LIB_VERSION} SOVERSION ${CAFFE_PARSER_LIB_SOVERSION})
endif()
@@ -128,6 +131,7 @@ if(BUILD_ONNX_PARSER)
set(armnn_onnx_parser_sources)
list(APPEND armnn_onnx_parser_sources
include/armnnOnnxParser/IOnnxParser.hpp
+ include/armnnOnnxParser/Version.hpp
src/armnnOnnxParser/OnnxParser.hpp
src/armnnOnnxParser/OnnxParser.cpp
${ONNX_GENERATED_SOURCES}/onnx/onnx.pb.cc
@@ -145,13 +149,14 @@ if(BUILD_ONNX_PARSER)
# Protobuf
target_link_libraries(armnnOnnxParser ${PROTOBUF_LIBRARIES})
- set_target_properties(armnnOnnxParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
+ set_target_properties(armnnOnnxParser PROPERTIES VERSION ${ONNX_PARSER_LIB_VERSION} SOVERSION ${ONNX_PARSER_LIB_SOVERSION})
endif()
if(BUILD_TF_PARSER)
set(armnn_tf_parser_sources)
list(APPEND armnn_tf_parser_sources
include/armnnTfParser/ITfParser.hpp
+ include/armnnTfParser/Version.hpp
src/armnnTfParser/TfParser.hpp
src/armnnTfParser/TfParser.cpp
${TF_PROTOBUFS}
@@ -169,7 +174,7 @@ if(BUILD_TF_PARSER)
# Protobuf (use the specific version tensorflow wants)
target_link_libraries(armnnTfParser ${PROTOBUF_LIBRARIES})
- set_target_properties(armnnTfParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
+ set_target_properties(armnnTfParser PROPERTIES VERSION ${TF_PARSER_LIB_VERSION} SOVERSION ${TF_PARSER_LIB_SOVERSION})
endif()
if(BUILD_ARMNN_QUANTIZER AND ARMNNREF)
diff --git a/cmake/DelegateVersion.cmake b/cmake/DelegateVersion.cmake
new file mode 100644
index 0000000000..caaede85bc
--- /dev/null
+++ b/cmake/DelegateVersion.cmake
@@ -0,0 +1,18 @@
+#
+# Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+# SPDX-License-Identifier: MIT
+#
+
+# Read the ArmNN Delegate version components from file
+file(READ ${CMAKE_CURRENT_LIST_DIR}/../delegate/include/Version.hpp delegateVersion)
+
+# Parse the ArmNN Delegate version components
+string(REGEX MATCH "#define DELEGATE_MAJOR_VERSION ([0-9]*)" _ ${delegateVersion})
+set(DELEGATE_MAJOR_VERSION ${CMAKE_MATCH_1})
+string(REGEX MATCH "#define DELEGATE_MINOR_VERSION ([0-9]*)" _ ${delegateVersion})
+set(DELEGATE_MINOR_VERSION ${CMAKE_MATCH_1})
+
+# Define LIB version
+set(DELEGATE_LIB_VERSION "${DELEGATE_MAJOR_VERSION}.${DELEGATE_MINOR_VERSION}")
+# Define LIB soversion
+set(DELEGATE_LIB_SOVERSION "${DELEGATE_MAJOR_VERSION}") \ No newline at end of file
diff --git a/cmake/ParserVersion.cmake b/cmake/ParserVersion.cmake
new file mode 100644
index 0000000000..e7a5234506
--- /dev/null
+++ b/cmake/ParserVersion.cmake
@@ -0,0 +1,67 @@
+#
+# Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+# SPDX-License-Identifier: MIT
+#
+
+# Read the CaffeParser version components from file
+file(READ ${CMAKE_CURRENT_LIST_DIR}/../include/armnnCaffeParser/Version.hpp caffeVersion)
+
+# Parse the CaffeParser version components
+string(REGEX MATCH "#define CAFFE_PARSER_MAJOR_VERSION ([0-9]*)" _ ${caffeVersion})
+set(CAFFE_PARSER_MAJOR_VERSION ${CMAKE_MATCH_1})
+string(REGEX MATCH "#define CAFFE_PARSER_MINOR_VERSION ([0-9]*)" _ ${caffeVersion})
+set(CAFFE_PARSER_MINOR_VERSION ${CMAKE_MATCH_1})
+
+# Define LIB version
+set(CAFFE_PARSER_LIB_VERSION "${CAFFE_PARSER_MAJOR_VERSION}.${CAFFE_PARSER_MINOR_VERSION}")
+
+# Define LIB soversion
+set(CAFFE_PARSER_LIB_SOVERSION "${CAFFE_PARSER_MAJOR_VERSION}")
+
+
+# Read the OnnxParser version components from file
+file(READ ${CMAKE_CURRENT_LIST_DIR}/../include/armnnOnnxParser/Version.hpp onnxVersion)
+
+# Parse the OnnxParser version components
+string(REGEX MATCH "#define ONNX_PARSER_MAJOR_VERSION ([0-9]*)" _ ${onnxVersion})
+set(ONNX_PARSER_MAJOR_VERSION ${CMAKE_MATCH_1})
+string(REGEX MATCH "#define ONNX_PARSER_MINOR_VERSION ([0-9]*)" _ ${onnxVersion})
+set(ONNX_PARSER_MINOR_VERSION ${CMAKE_MATCH_1})
+
+# Define LIB version
+set(ONNX_PARSER_LIB_VERSION "${ONNX_PARSER_MAJOR_VERSION}.${ONNX_PARSER_MINOR_VERSION}")
+
+# Define LIB soversion
+set(ONNX_PARSER_LIB_SOVERSION "${ONNX_PARSER_MAJOR_VERSION}")
+
+
+# Read the TfLiteParser version components from file
+file(READ ${CMAKE_CURRENT_LIST_DIR}/../include/armnnTfLiteParser/Version.hpp tfLiteVersion)
+
+# Parse the TfLiteParser version components
+string(REGEX MATCH "#define TFLITE_PARSER_MAJOR_VERSION ([0-9]*)" _ ${tfLiteVersion})
+set(TFLITE_PARSER_MAJOR_VERSION ${CMAKE_MATCH_1})
+string(REGEX MATCH "#define TFLITE_PARSER_MINOR_VERSION ([0-9]*)" _ ${tfLiteVersion})
+set(TFLITE_PARSER_MINOR_VERSION ${CMAKE_MATCH_1})
+
+# Define LIB version
+set(TFLITE_PARSER_LIB_VERSION "${TFLITE_PARSER_MAJOR_VERSION}.${TFLITE_PARSER_MINOR_VERSION}")
+
+# Define LIB soversion
+set(TFLITE_PARSER_LIB_SOVERSION "${TFLITE_PARSER_MAJOR_VERSION}")
+
+
+# Read the TfParser version components from file
+file(READ ${CMAKE_CURRENT_LIST_DIR}/../include/armnnTfParser/Version.hpp tfVersion)
+
+# Parse the TfParser version components
+string(REGEX MATCH "#define TF_PARSER_MAJOR_VERSION ([0-9]*)" _ ${tfVersion})
+set(TF_PARSER_MAJOR_VERSION ${CMAKE_MATCH_1})
+string(REGEX MATCH "#define TF_PARSER_MINOR_VERSION ([0-9]*)" _ ${tfVersion})
+set(TF_PARSER_MINOR_VERSION ${CMAKE_MATCH_1})
+
+# Define LIB version
+set(TF_PARSER_LIB_VERSION "${TF_PARSER_MAJOR_VERSION}.${TF_PARSER_MINOR_VERSION}")
+
+# Define LIB soversion
+set(TF_PARSER_LIB_SOVERSION "${TF_PARSER_MAJOR_VERSION}") \ No newline at end of file
diff --git a/delegate/CMakeLists.txt b/delegate/CMakeLists.txt
index eda5b935e3..777702e0b4 100644
--- a/delegate/CMakeLists.txt
+++ b/delegate/CMakeLists.txt
@@ -14,6 +14,7 @@ set(armnnDelegate_sources)
list(APPEND armnnDelegate_sources
include/armnn_delegate.hpp
include/DelegateOptions.hpp
+ include/Version.hpp
src/armnn_delegate.cpp
src/armnn_external_delegate.cpp
src/DelegateOptions.cpp
@@ -103,6 +104,8 @@ target_include_directories(thirdparty_headers INTERFACE $<BUILD_INTERFACE:${ARMN
target_compile_options(thirdparty_headers INTERFACE -Wno-old-style-cast)
+set_target_properties(armnnDelegate PROPERTIES VERSION ${DELEGATE_LIB_VERSION} SOVERSION ${DELEGATE_LIB_SOVERSION})
+
option(BUILD_UNIT_TESTS "Build unit tests" ON)
if(BUILD_UNIT_TESTS)
set(armnnDelegate_unittest_sources)
diff --git a/delegate/include/Version.hpp b/delegate/include/Version.hpp
new file mode 100644
index 0000000000..f1ac1fe111
--- /dev/null
+++ b/delegate/include/Version.hpp
@@ -0,0 +1,29 @@
+//
+// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+namespace armnnDelegate
+{
+
+/// Macro utils
+#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s)
+#define STRINGIFY_MACRO(s) #s
+
+// ArmNN Delegate version components
+#define DELEGATE_MAJOR_VERSION 23
+#define DELEGATE_MINOR_VERSION 0
+#define DELEGATE_PATCH_VERSION 0
+
+/// DELEGATE_VERSION: "X.Y.Z"
+/// where:
+/// X = Major version number
+/// Y = Minor version number
+/// Z = Patch version number
+#define DELEGATE_VERSION STRINGIFY_VALUE(DELEGATE_MAJOR_VERSION) "." \
+ STRINGIFY_VALUE(DELEGATE_MINOR_VERSION) "." \
+ STRINGIFY_VALUE(DELEGATE_PATCH_VERSION)
+
+} //namespace armnnDelegate \ No newline at end of file
diff --git a/delegate/include/armnn_delegate.hpp b/delegate/include/armnn_delegate.hpp
index adf264aabb..b213211ae9 100644
--- a/delegate/include/armnn_delegate.hpp
+++ b/delegate/include/armnn_delegate.hpp
@@ -47,6 +47,9 @@ public:
TfLiteDelegate* GetDelegate();
+ /// Retrieve version in X.Y.Z form
+ static const std::string GetVersion();
+
private:
TfLiteDelegate m_Delegate = {
reinterpret_cast<void*>(this), // .data_
diff --git a/delegate/src/armnn_delegate.cpp b/delegate/src/armnn_delegate.cpp
index 639e514a78..3ebc0cc6b5 100644
--- a/delegate/src/armnn_delegate.cpp
+++ b/delegate/src/armnn_delegate.cpp
@@ -5,6 +5,8 @@
#include <armnn_delegate.hpp>
+#include "Version.hpp"
+
#include "Activation.hpp"
#include "ArgMinMax.hpp"
#include "BatchSpace.hpp"
@@ -35,6 +37,7 @@
#include <tensorflow/lite/context_util.h>
#include <algorithm>
+#include <iostream>
#include <sstream>
namespace armnnDelegate
@@ -217,6 +220,11 @@ TfLiteDelegate* Delegate::GetDelegate()
return &m_Delegate;
}
+const std::string Delegate::GetVersion()
+{
+ return DELEGATE_VERSION;
+}
+
TfLiteStatus ArmnnSubgraph::AddInputLayer(DelegateData& delegateData,
TfLiteContext* tfLiteContext,
const TfLiteIntArray* inputs,
diff --git a/include/armnnCaffeParser/Version.hpp b/include/armnnCaffeParser/Version.hpp
new file mode 100644
index 0000000000..0894182f80
--- /dev/null
+++ b/include/armnnCaffeParser/Version.hpp
@@ -0,0 +1,29 @@
+//
+// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+namespace armnnCaffeParser
+{
+
+/// Macro utils
+#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s)
+#define STRINGIFY_MACRO(s) #s
+
+// CaffeParser version components
+#define CAFFE_PARSER_MAJOR_VERSION 23
+#define CAFFE_PARSER_MINOR_VERSION 0
+#define CAFFE_PARSER_PATCH_VERSION 0
+
+/// CAFFE_PARSER_VERSION: "X.Y.Z"
+/// where:
+/// X = Major version number
+/// Y = Minor version number
+/// Z = Patch version number
+#define CAFFE_PARSER_VERSION STRINGIFY_VALUE(CAFFE_PARSER_MAJOR_VERSION) "." \
+ STRINGIFY_VALUE(CAFFE_PARSER_MINOR_VERSION) "." \
+ STRINGIFY_VALUE(CAFFE_PARSER_PATCH_VERSION)
+
+} //namespace armnnCaffeParser \ No newline at end of file
diff --git a/include/armnnOnnxParser/Version.hpp b/include/armnnOnnxParser/Version.hpp
new file mode 100644
index 0000000000..6c08c69f07
--- /dev/null
+++ b/include/armnnOnnxParser/Version.hpp
@@ -0,0 +1,29 @@
+//
+// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+namespace armnnOnnxParser
+{
+
+/// Macro utils
+#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s)
+#define STRINGIFY_MACRO(s) #s
+
+// OnnxParser version components
+#define ONNX_PARSER_MAJOR_VERSION 23
+#define ONNX_PARSER_MINOR_VERSION 0
+#define ONNX_PARSER_PATCH_VERSION 0
+
+/// ONNX_PARSER_VERSION: "X.Y.Z"
+/// where:
+/// X = Major version number
+/// Y = Minor version number
+/// Z = Patch version number
+#define ONNX_PARSER_VERSION STRINGIFY_VALUE(ONNX_PARSER_MAJOR_VERSION) "." \
+ STRINGIFY_VALUE(ONNX_PARSER_MINOR_VERSION) "." \
+ STRINGIFY_VALUE(ONNX_PARSER_PATCH_VERSION)
+
+} //namespace armnnOnnxParser \ No newline at end of file
diff --git a/include/armnnTfLiteParser/Version.hpp b/include/armnnTfLiteParser/Version.hpp
new file mode 100644
index 0000000000..6c443d1782
--- /dev/null
+++ b/include/armnnTfLiteParser/Version.hpp
@@ -0,0 +1,29 @@
+//
+// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+namespace armnnTfLiteParser
+{
+
+/// Macro utils
+#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s)
+#define STRINGIFY_MACRO(s) #s
+
+// TfLiteParser version components
+#define TFLITE_PARSER_MAJOR_VERSION 23
+#define TFLITE_PARSER_MINOR_VERSION 0
+#define TFLITE_PARSER_PATCH_VERSION 0
+
+/// TFLITE_PARSER_VERSION: "X.Y.Z"
+/// where:
+/// X = Major version number
+/// Y = Minor version number
+/// Z = Patch version number
+#define TFLITE_PARSER_VERSION STRINGIFY_VALUE(TFLITE_PARSER_MAJOR_VERSION) "." \
+ STRINGIFY_VALUE(TFLITE_PARSER_MINOR_VERSION) "." \
+ STRINGIFY_VALUE(TFLITE_PARSER_PATCH_VERSION)
+
+} //namespace armnnTfLiteParser
diff --git a/include/armnnTfParser/Version.hpp b/include/armnnTfParser/Version.hpp
new file mode 100644
index 0000000000..44c4a25cda
--- /dev/null
+++ b/include/armnnTfParser/Version.hpp
@@ -0,0 +1,29 @@
+//
+// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+namespace armnnTfParser
+{
+
+/// Macro utils
+#define STRINGIFY_VALUE(s) STRINGIFY_MACRO(s)
+#define STRINGIFY_MACRO(s) #s
+
+// tfParser version components
+#define TF_PARSER_MAJOR_VERSION 23
+#define TF_PARSER_MINOR_VERSION 0
+#define TF_PARSER_PATCH_VERSION 0
+
+/// TF_PARSER_VERSION: "X.Y.Z"
+/// where:
+/// X = Major version number
+/// Y = Minor version number
+/// Z = Patch version number
+#define TF_PARSER_VERSION STRINGIFY_VALUE(TF_PARSER_MAJOR_VERSION) "." \
+ STRINGIFY_VALUE(TF_PARSER_MINOR_VERSION) "." \
+ STRINGIFY_VALUE(TF_PARSER_PATCH_VERSION)
+
+} //namespace armnnTfParser
diff --git a/src/armnnCaffeParser/CaffeParser.cpp b/src/armnnCaffeParser/CaffeParser.cpp
index dfb9cec206..463f3eb2a5 100644
--- a/src/armnnCaffeParser/CaffeParser.cpp
+++ b/src/armnnCaffeParser/CaffeParser.cpp
@@ -5,6 +5,8 @@
#include "CaffeParser.hpp"
#include "RecordByRecordCaffeParser.hpp"
+#include "armnnCaffeParser/Version.hpp"
+
#include "armnn/Descriptors.hpp"
#include "armnn/INetwork.hpp"
#include "armnn/Utils.hpp"
@@ -35,6 +37,7 @@
#include <google/protobuf/wire_format.h>
#include <cmath>
+#include <iostream>
#include <sstream>
#include <queue>
#include <fcntl.h>
@@ -2250,6 +2253,11 @@ INetworkPtr ICaffeParser::CaffeParserImpl::CreateNetworkFromNetParameter(NetPara
return move(m_Network);
}
+const std::string ICaffeParser::CaffeParserImpl::GetVersion()
+{
+ return CAFFE_PARSER_VERSION;
+}
+
void ICaffeParser::CaffeParserImpl::Cleanup() {
// cleanup, in case we reuse this parser
m_InputShapes.clear();
diff --git a/src/armnnCaffeParser/CaffeParser.hpp b/src/armnnCaffeParser/CaffeParser.hpp
index f369d5f2f9..9f93569742 100644
--- a/src/armnnCaffeParser/CaffeParser.hpp
+++ b/src/armnnCaffeParser/CaffeParser.hpp
@@ -54,6 +54,9 @@ public:
/// Retrieves binding info (layer id and tensor info) for the network output identified by the given layer name.
BindingPointInfo GetNetworkOutputBindingInfo(const std::string& name) const;
+ /// Retrieve version in X.Y.Z form
+ static const std::string GetVersion();
+
CaffeParserImpl();
virtual ~CaffeParserImpl() = default;
diff --git a/src/armnnOnnxParser/OnnxParser.cpp b/src/armnnOnnxParser/OnnxParser.cpp
index b4e7133239..81d9e3d240 100644
--- a/src/armnnOnnxParser/OnnxParser.cpp
+++ b/src/armnnOnnxParser/OnnxParser.cpp
@@ -4,6 +4,8 @@
//
#include "OnnxParser.hpp"
+#include "armnnOnnxParser/Version.hpp"
+
#include <armnn/Descriptors.hpp>
#include <armnn/utility/Assert.hpp>
#include <armnn/utility/NumericCast.hpp>
@@ -14,6 +16,7 @@
#include <google/protobuf/text_format.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
+#include <iostream>
#include <numeric>
using namespace armnn;
@@ -1849,4 +1852,9 @@ std::vector<std::string> OnnxParserImpl::GetOutputs(ModelPtr& model)
return outputNames;
}
+const std::string OnnxParserImpl::GetVersion()
+{
+ return ONNX_PARSER_VERSION;
+}
+
} // namespace armnnOnnxParser
diff --git a/src/armnnOnnxParser/OnnxParser.hpp b/src/armnnOnnxParser/OnnxParser.hpp
index 0db93248bc..7716e50fff 100644
--- a/src/armnnOnnxParser/OnnxParser.hpp
+++ b/src/armnnOnnxParser/OnnxParser.hpp
@@ -61,6 +61,9 @@ public:
/// Retrieve outputs names
static std::vector<std::string> GetOutputs(ModelPtr& model);
+ /// Retrieve version in X.Y.Z form
+ static const std::string GetVersion();
+
private:
/// Parses a ModelProto loaded into memory from one of the other CreateNetwork*
diff --git a/src/armnnTfLiteParser/CMakeLists.txt b/src/armnnTfLiteParser/CMakeLists.txt
index 12f2127375..6a02c94b82 100755
--- a/src/armnnTfLiteParser/CMakeLists.txt
+++ b/src/armnnTfLiteParser/CMakeLists.txt
@@ -6,6 +6,7 @@ if(BUILD_TF_LITE_PARSER)
set(armnn_tf_lite_parser_sources)
list(APPEND armnn_tf_lite_parser_sources
../../include/armnnTfLiteParser/ITfLiteParser.hpp
+ ../../include/armnnTfLiteParser/Version.hpp
TfLiteParser.hpp
TfLiteParser.cpp
)
@@ -33,7 +34,7 @@ if(BUILD_TF_LITE_PARSER)
target_link_libraries(armnnTfLiteParser armnn debug ${FLATBUFFERS_LIBRARY_DEBUG} optimized ${FLATBUFFERS_LIBRARY_RELEASE})
endif()
- set_target_properties(armnnTfLiteParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
+ set_target_properties(armnnTfLiteParser PROPERTIES VERSION ${TFLITE_PARSER_LIB_VERSION} SOVERSION ${TFLITE_PARSER_LIB_SOVERSION} )
install(TARGETS armnnTfLiteParser
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
diff --git a/src/armnnTfLiteParser/TfLiteParser.cpp b/src/armnnTfLiteParser/TfLiteParser.cpp
index ac0e40eea6..1b9157618e 100644
--- a/src/armnnTfLiteParser/TfLiteParser.cpp
+++ b/src/armnnTfLiteParser/TfLiteParser.cpp
@@ -5,6 +5,8 @@
#include "TfLiteParser.hpp"
+#include "armnnTfLiteParser/Version.hpp"
+
#include <armnn/BackendOptions.hpp>
#include <armnn/Descriptors.hpp>
#include <armnn/Exceptions.hpp>
@@ -30,8 +32,9 @@
#include <fmt/format.h>
-#include <fstream>
#include <algorithm>
+#include <fstream>
+#include <iostream>
#include <limits>
#include <numeric>
#include <sstream>
@@ -3590,6 +3593,11 @@ std::vector<std::string> TfLiteParserImpl::GetSubgraphOutputTensorNames(size_t s
return result;
}
+const std::string TfLiteParserImpl::GetVersion()
+{
+ return TFLITE_PARSER_VERSION;
+}
+
TfLiteParserImpl::SupportedDataStorage::SupportedDataStorage(std::unique_ptr<float[]> && data)
: m_FloatData(std::move(data))
, m_Uint8Data(nullptr)
diff --git a/src/armnnTfLiteParser/TfLiteParser.hpp b/src/armnnTfLiteParser/TfLiteParser.hpp
index 12a085d6ca..2603d9018a 100644
--- a/src/armnnTfLiteParser/TfLiteParser.hpp
+++ b/src/armnnTfLiteParser/TfLiteParser.hpp
@@ -79,6 +79,9 @@ public:
static armnn::TensorInfo OutputShapeOfReshape(const armnn::TensorInfo & inputTensorInfo,
const std::vector<int32_t> & targetDimsIn);
+ /// Retrieve version in X.Y.Z form
+ static const std::string GetVersion();
+
private:
// No copying allowed until it is wanted and properly implemented
TfLiteParserImpl(const TfLiteParserImpl &) = delete;
diff --git a/src/armnnTfParser/TfParser.cpp b/src/armnnTfParser/TfParser.cpp
index d13a277924..1e566fe943 100755
--- a/src/armnnTfParser/TfParser.cpp
+++ b/src/armnnTfParser/TfParser.cpp
@@ -5,6 +5,8 @@
#include "TfParser.hpp"
+#include "armnnTfParser/Version.hpp"
+
#include <armnn/TypesUtils.hpp>
#include <armnn/Descriptors.hpp>
@@ -25,6 +27,7 @@
#include <fmt/core.h>
#include <fmt/format.h>
+#include <iostream>
#include <numeric>
using namespace armnnUtils;
@@ -3734,4 +3737,9 @@ void ITfParser::TfParserImpl::TrackBindingPoint(IConnectableLayer* layer,
}
}
+const std::string ITfParser::TfParserImpl::GetVersion()
+{
+ return TF_PARSER_VERSION;
+}
+
} // namespace armnnTfParser
diff --git a/src/armnnTfParser/TfParser.hpp b/src/armnnTfParser/TfParser.hpp
index 5c04cceb82..31e074de93 100644
--- a/src/armnnTfParser/TfParser.hpp
+++ b/src/armnnTfParser/TfParser.hpp
@@ -88,6 +88,9 @@ public:
/// Retrieves binding info (layer id and tensor info) for the network output identified by the given layer name.
BindingPointInfo GetNetworkOutputBindingInfo(const std::string& name) const;
+ /// Retrieve version in X.Y.Z form
+ static const std::string GetVersion();
+
TfParserImpl();
~TfParserImpl() = default;