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
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2b6e90..0a71de7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,8 @@
 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 @@
     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 @@
 
     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 @@
     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 @@
 
     # 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 @@
 
     # 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 0000000..caaede8
--- /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 0000000..e7a5234
--- /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 eda5b93..777702e 100644
--- a/delegate/CMakeLists.txt
+++ b/delegate/CMakeLists.txt
@@ -14,6 +14,7 @@
 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_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 0000000..f1ac1fe
--- /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 adf264a..b213211 100644
--- a/delegate/include/armnn_delegate.hpp
+++ b/delegate/include/armnn_delegate.hpp
@@ -47,6 +47,9 @@
 
     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 639e514..3ebc0cc 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 @@
     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 0000000..0894182
--- /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 0000000..6c08c69
--- /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 0000000..6c443d1
--- /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 0000000..44c4a25
--- /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 dfb9cec..463f3eb 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 @@
     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 f369d5f..9f93569 100644
--- a/src/armnnCaffeParser/CaffeParser.hpp
+++ b/src/armnnCaffeParser/CaffeParser.hpp
@@ -54,6 +54,9 @@
     /// 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 b4e7133..81d9e3d 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 @@
     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 0db9324..7716e50 100644
--- a/src/armnnOnnxParser/OnnxParser.hpp
+++ b/src/armnnOnnxParser/OnnxParser.hpp
@@ -61,6 +61,9 @@
     /// 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 12f2127..6a02c94 100755
--- a/src/armnnTfLiteParser/CMakeLists.txt
+++ b/src/armnnTfLiteParser/CMakeLists.txt
@@ -6,6 +6,7 @@
     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 @@
         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 ac0e40e..1b91576 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 @@
     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 12a085d..2603d90 100644
--- a/src/armnnTfLiteParser/TfLiteParser.hpp
+++ b/src/armnnTfLiteParser/TfLiteParser.hpp
@@ -79,6 +79,9 @@
     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 d13a277..1e566fe 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 @@
     }
 }
 
+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 5c04cce..31e074d 100644
--- a/src/armnnTfParser/TfParser.hpp
+++ b/src/armnnTfParser/TfParser.hpp
@@ -88,6 +88,9 @@
     /// 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;