diff options
author | Colm Donelan <Colm.Donelan@arm.com> | 2020-05-12 17:17:59 +0100 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2020-05-13 08:54:40 +0000 |
commit | 94c97881d5971576eddca3416228b84156033395 (patch) | |
tree | 48e08aae40a0ee62c87702c8da8aae71125a0b6e | |
parent | 479aef883b345d9cdab52d2f1640a8a1c15b888e (diff) | |
download | armnn-94c97881d5971576eddca3416228b84156033395.tar.gz |
IVGCVSW-4776 Warn when MIN_STATIC_GUID is returned from GenerateStaticId multiple times.
* Modify StaticGuidGeneratorCollisionTest to identify cases where
MIN_STATIC_GUID has been returned from GenerateStaticId more than once.
Output a warning rather than an error as this can happen on 32bit
systems.
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: I47e9a1d9ff09c25da24abb4b0efe63d3000aa1c5
-rw-r--r-- | src/profiling/test/ProfilingGuidTest.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/profiling/test/ProfilingGuidTest.cpp b/src/profiling/test/ProfilingGuidTest.cpp index b8f6b88479..392833a364 100644 --- a/src/profiling/test/ProfilingGuidTest.cpp +++ b/src/profiling/test/ProfilingGuidTest.cpp @@ -90,7 +90,17 @@ BOOST_AUTO_TEST_CASE(StaticGuidGeneratorCollisionTest) ProfilingStaticGuid guid = generator.GenerateStaticId(str.c_str()); if (guids.find(guid) != guids.end()) { - BOOST_ERROR(boost::str(boost::format("GUID collision occurred: %1% -> %2%") % str % guid)); + // If we're running on a 32bit system it is more likely to get a GUID clash over 1 million executions. + // We can generally detect this when the GUID turns out to be MIN_STATIC_GUID. Output a warning + // message rather than error in this case. + if (guid == ProfilingGuid(armnn::profiling::MIN_STATIC_GUID)) + { + BOOST_WARN("MIN_STATIC_GUID returned more than once from GenerateStaticId."); + } + else + { + BOOST_ERROR(boost::str(boost::format("GUID collision occurred: %1% -> %2%") % str % guid)); + } break; } guids.insert(guid); |