Bugfix: Profiling use of substr() incorrectly parses semantic versioning
authorFrancis Murtagh <francis.murtagh@arm.com>
Fri, 22 May 2020 11:49:25 +0000 (12:49 +0100)
committerJan Eilers <jan.eilers@arm.com>
Fri, 22 May 2020 17:15:25 +0000 (18:15 +0100)
 * With semantic versioning ARMNN_VERSION is changed from 20200500 to 21.0.0
   causing this function to return "Armnn .0..0" instead of "Armnn 20.1"
 * Remove the use of substrings and instead use the Major/Minor macros to
   give the expected output format: "Armnn 21.0" compared to last release's
   "Armnn 20.02"

Signed-off-by: Francis Murtagh <francis.murtagh@arm.com>
Change-Id: Id255ff154f59e922434f72a68563ccc6126e187a

src/profiling/ProfilingUtils.cpp

index 4e5fcf8..f151dd6 100644 (file)
@@ -284,8 +284,7 @@ std::string GetHardwareVersion()
 
 std::string GetSoftwareVersion()
 {
-    std::string armnnVersion(ARMNN_VERSION);
-    std::string result = "Armnn " + armnnVersion.substr(2,2) + "." + armnnVersion.substr(4,2);
+    std::string result = "Armnn " + std::to_string(ARMNN_MAJOR_VERSION) + "." + std::to_string(ARMNN_MINOR_VERSION);
     return result;
 }