From ac001eebca101f2df4973d2f1d8cfca026e07419 Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Wed, 3 Feb 2021 10:43:04 +0000 Subject: 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 Change-Id: If29e1e6d9e615f9095ec1c01ad47acfff40b1dd5 --- CMakeLists.txt | 11 ++++-- cmake/DelegateVersion.cmake | 18 +++++++++ cmake/ParserVersion.cmake | 67 ++++++++++++++++++++++++++++++++++ delegate/CMakeLists.txt | 3 ++ delegate/include/Version.hpp | 29 +++++++++++++++ delegate/include/armnn_delegate.hpp | 3 ++ delegate/src/armnn_delegate.cpp | 8 ++++ include/armnnCaffeParser/Version.hpp | 29 +++++++++++++++ include/armnnOnnxParser/Version.hpp | 29 +++++++++++++++ include/armnnTfLiteParser/Version.hpp | 29 +++++++++++++++ include/armnnTfParser/Version.hpp | 29 +++++++++++++++ src/armnnCaffeParser/CaffeParser.cpp | 8 ++++ src/armnnCaffeParser/CaffeParser.hpp | 3 ++ src/armnnOnnxParser/OnnxParser.cpp | 8 ++++ src/armnnOnnxParser/OnnxParser.hpp | 3 ++ src/armnnTfLiteParser/CMakeLists.txt | 3 +- src/armnnTfLiteParser/TfLiteParser.cpp | 10 ++++- src/armnnTfLiteParser/TfLiteParser.hpp | 3 ++ src/armnnTfParser/TfParser.cpp | 8 ++++ src/armnnTfParser/TfParser.hpp | 3 ++ 20 files changed, 299 insertions(+), 5 deletions(-) create mode 100644 cmake/DelegateVersion.cmake create mode 100644 cmake/ParserVersion.cmake create mode 100644 delegate/include/Version.hpp create mode 100644 include/armnnCaffeParser/Version.hpp create mode 100644 include/armnnOnnxParser/Version.hpp create mode 100644 include/armnnTfLiteParser/Version.hpp create mode 100644 include/armnnTfParser/Version.hpp 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 $(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 +#include "Version.hpp" + #include "Activation.hpp" #include "ArgMinMax.hpp" #include "BatchSpace.hpp" @@ -35,6 +37,7 @@ #include #include +#include #include 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 #include +#include #include #include #include @@ -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 #include #include @@ -14,6 +16,7 @@ #include #include +#include #include using namespace armnn; @@ -1849,4 +1852,9 @@ std::vector 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 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 #include #include @@ -30,8 +32,9 @@ #include -#include #include +#include +#include #include #include #include @@ -3590,6 +3593,11 @@ std::vector TfLiteParserImpl::GetSubgraphOutputTensorNames(size_t s return result; } +const std::string TfLiteParserImpl::GetVersion() +{ + return TFLITE_PARSER_VERSION; +} + TfLiteParserImpl::SupportedDataStorage::SupportedDataStorage(std::unique_ptr && 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 & 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 #include @@ -25,6 +27,7 @@ #include #include +#include #include 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; -- cgit v1.2.1