diff options
author | Nikhil Raj <nikhil.raj@arm.com> | 2021-06-08 12:31:50 +0100 |
---|---|---|
committer | Nikhil Raj <nikhil.raj@arm.com> | 2021-06-08 16:04:14 +0100 |
commit | 5b1bcc93820b442bc4035c1e030a8d4a0983df91 (patch) | |
tree | 42b8cc8bcbd656ed9ac01fa18232867fce9959b3 /src/profiling/ProfilingGuidGenerator.hpp | |
parent | 400c593e03af3cc9131058b3cb30b787586f69a3 (diff) | |
download | armnn-5b1bcc93820b442bc4035c1e030a8d4a0983df91.tar.gz |
IVGCVSW-5834 Move the IProfilingGuidGenerator and ProfilingGuidGenerator into profiling common
Signed-off-by: Nikhil Raj <nikhil.raj@arm.com>
Change-Id: I0d672cc782cc2de66a88acf0d83fcd40208ace95
Diffstat (limited to 'src/profiling/ProfilingGuidGenerator.hpp')
-rw-r--r-- | src/profiling/ProfilingGuidGenerator.hpp | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/profiling/ProfilingGuidGenerator.hpp b/src/profiling/ProfilingGuidGenerator.hpp deleted file mode 100644 index 3798e0cc2d..0000000000 --- a/src/profiling/ProfilingGuidGenerator.hpp +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright © 2019 Arm Ltd and Contributors. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#pragma once - -#include "armnn/profiling/IProfilingGuidGenerator.hpp" - -#include <common/include/ProfilingGuid.hpp> - -#include <functional> -#include <mutex> - -namespace armnn -{ - -namespace profiling -{ - -class ProfilingGuidGenerator : public IProfilingGuidGenerator -{ -public: - /// Construct a generator with the default address space static/dynamic partitioning - ProfilingGuidGenerator() : m_Sequence(0) {} - - /// Return the next random Guid in the sequence - inline ProfilingDynamicGuid NextGuid() override - { - std::lock_guard<std::mutex> sequencelock(m_SequenceMutex); - ProfilingDynamicGuid guid(m_Sequence); - m_Sequence++; - if (m_Sequence >= MIN_STATIC_GUID) - { - // Reset the sequence to 0 when it reaches the upper bound of dynamic guid - m_Sequence = 0; - } - return guid; - } - - /// Create a ProfilingStaticGuid based on a hash of the string - inline ProfilingStaticGuid GenerateStaticId(const std::string& str) override - { - uint64_t staticHash = m_Hash(str) | MIN_STATIC_GUID; - return ProfilingStaticGuid(staticHash); - } - - /// Reset the generator back to zero. Used mainly for test. - inline void Reset() - { - std::lock_guard<std::mutex> sequencelock(m_SequenceMutex); - m_Sequence = 0; - } - -private: - std::hash<std::string> m_Hash; - uint64_t m_Sequence; - std::mutex m_SequenceMutex; -}; - -} // namespace profiling - -} // namespace armnn |