diff options
author | Keith Davis <keith.davis@arm.com> | 2019-10-24 17:30:41 +0100 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2019-11-06 08:30:31 +0000 |
commit | 3201eea0565ce2bb0418d1936fec71bdeb14c084 (patch) | |
tree | f73017f6338d707165dbcfd717ddc9793b1858e0 /tests/profiling/gatordmock/MockUtils.cpp | |
parent | fe2e2cbbbe5294072b2d58755b8a095f32a97e75 (diff) | |
download | armnn-3201eea0565ce2bb0418d1936fec71bdeb14c084.tar.gz |
IVGCVSW-3444 File Only Profiling Connection
* Add FileOnlyProfilingConnection Decorator
* Fix bug where Conn Ack not automatically sent back
* Modify GatordMock to use the Counter Directory class.
* Promote DirectoryCaptureCommandHandler from GatordMock into ArmNN.
* Remove MockUtils as it's contents were moved or deleted.
* Rewrite GatordMockTests to use Counter Directory class.
* Flush streams in ProfilingConnectionDumpToFileDecorator::Close.
Signed-off-by: Keith Davis <keith.davis@arm.com>
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: I77b2aedece24150dd31691b577f3b5d81b2e226f
Diffstat (limited to 'tests/profiling/gatordmock/MockUtils.cpp')
-rw-r--r-- | tests/profiling/gatordmock/MockUtils.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/tests/profiling/gatordmock/MockUtils.cpp b/tests/profiling/gatordmock/MockUtils.cpp deleted file mode 100644 index bdbffc9253..0000000000 --- a/tests/profiling/gatordmock/MockUtils.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// -// Copyright © 2019 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#include "MockUtils.hpp" - -namespace armnn -{ - -namespace gatordmock -{ - -std::string CentreAlignFormatting(const std::string& stringToPass, const int spacingWidth) -{ - std::stringstream outputStream, centrePadding; - int padding = spacingWidth - static_cast<int>(stringToPass.size()); - - for (int i = 0; i < padding / 2; ++i) - { - centrePadding << " "; - } - - outputStream << centrePadding.str() << stringToPass << centrePadding.str(); - - if (padding > 0 && padding %2 != 0) - { - outputStream << " "; - } - - return outputStream.str(); -} - -std::string GetStringNameFromBuffer(const unsigned char* const data, uint32_t offset) -{ - std::string deviceName; - u_char nextChar = profiling::ReadUint8(data, offset); - - while (IsValidChar(nextChar)) - { - deviceName += static_cast<char>(nextChar); - offset ++; - nextChar = profiling::ReadUint8(data, offset); - } - - return deviceName; -} - -bool IsValidChar(unsigned char c) -{ - // Check that the given character has ASCII 7-bit encoding, alpha-numeric, whitespace, and underscore only - return c < 128 && (std::isalnum(c) || c == '_' || c == ' '); -} - -} // gatordmock - -} // armnn |