diff options
-rw-r--r-- | CMakeLists.txt | 17 | ||||
-rw-r--r-- | include/armnn/profiling/ITimelineDecoder.hpp (renamed from tests/profiling/timelineDecoder/ITimelineDecoder.hpp) | 0 | ||||
-rw-r--r-- | src/timelineDecoder/CMakeLists.txt | 21 | ||||
-rw-r--r-- | src/timelineDecoder/TimelineCaptureCommandHandler.cpp (renamed from tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.cpp) | 5 | ||||
-rw-r--r-- | src/timelineDecoder/TimelineCaptureCommandHandler.hpp (renamed from tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.hpp) | 6 | ||||
-rw-r--r-- | src/timelineDecoder/TimelineDecoder.cpp (renamed from tests/profiling/timelineDecoder/TimelineDecoder.cpp) | 6 | ||||
-rw-r--r-- | src/timelineDecoder/TimelineDecoder.hpp (renamed from tests/profiling/timelineDecoder/TimelineDecoder.hpp) | 7 | ||||
-rw-r--r-- | src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp (renamed from tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp) | 4 | ||||
-rw-r--r-- | src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.hpp (renamed from tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.hpp) | 3 | ||||
-rw-r--r-- | src/timelineDecoder/tests/TimelineTests.cpp (renamed from tests/profiling/timelineDecoder/tests/TimelineTests.cpp) | 13 | ||||
-rw-r--r-- | tests/profiling/gatordmock/tests/GatordMockTests.cpp | 3 |
11 files changed, 52 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e3b794ab53..5da8133a39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -864,7 +864,7 @@ if(BUILD_UNIT_TESTS) if(BUILD_GATORD_MOCK) list(APPEND unittest_sources tests/profiling/gatordmock/tests/GatordMockTests.cpp - tests/profiling/timelineDecoder/tests/TimelineTests.cpp + src/timelineDecoder/tests/TimelineTests.cpp ) endif() @@ -900,6 +900,7 @@ if(BUILD_UNIT_TESTS) if(BUILD_GATORD_MOCK) target_link_libraries(UnitTests gatordMockService) + target_link_libraries(UnitTests timelineDecoder) endif() if(BUILD_TF_LITE_PARSER) @@ -967,6 +968,8 @@ if (BUILD_ARMNN_SERIALIZER AND (BUILD_TF_PARSER OR BUILD_TF_LITE_PARSER OR BUILD endif() if(BUILD_GATORD_MOCK) + add_subdirectory(src/timelineDecoder) + set(gatord_mock_sources) list(APPEND gatord_mock_sources tests/profiling/gatordmock/CommandFileParser.hpp @@ -981,19 +984,9 @@ if(BUILD_GATORD_MOCK) tests/profiling/gatordmock/PeriodicCounterSelectionResponseHandler.hpp tests/profiling/gatordmock/StreamMetadataCommandHandler.cpp tests/profiling/gatordmock/StreamMetadataCommandHandler.hpp - tests/profiling/timelineDecoder/ITimelineDecoder.hpp - tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.cpp - tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.hpp - tests/profiling/timelineDecoder/TimelineDecoder.cpp - tests/profiling/timelineDecoder/TimelineDecoder.hpp - tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp - tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.hpp ) - include_directories(${Boost_INCLUDE_DIRS} src/profiling) - include_directories(${Boost_INCLUDE_DIRS} tests/profiling) - include_directories(${Boost_INCLUDE_DIRS} tests/profiling/gatordmock) - include_directories(${Boost_INCLUDE_DIRS} tests/profiling/timelineDecoder) + include_directories(src/timelineDecoder src/profiling tests/profiling tests/profiling/gatordmock) add_library_ex(gatordMockService STATIC ${gatord_mock_sources}) target_include_directories(gatordMockService PRIVATE src/armnnUtils) diff --git a/tests/profiling/timelineDecoder/ITimelineDecoder.hpp b/include/armnn/profiling/ITimelineDecoder.hpp index 7199b38d24..7199b38d24 100644 --- a/tests/profiling/timelineDecoder/ITimelineDecoder.hpp +++ b/include/armnn/profiling/ITimelineDecoder.hpp diff --git a/src/timelineDecoder/CMakeLists.txt b/src/timelineDecoder/CMakeLists.txt new file mode 100644 index 0000000000..6b8517acbc --- /dev/null +++ b/src/timelineDecoder/CMakeLists.txt @@ -0,0 +1,21 @@ +# +# Copyright © 2020 Arm Ltd. All rights reserved. +# SPDX-License-Identifier: MIT +# + +set(timelineDecoder_sources) +list(APPEND timelineDecoder_sources + ../../include/armnn/profiling/ITimelineDecoder.hpp + TimelineCaptureCommandHandler.cpp + TimelineCaptureCommandHandler.hpp + TimelineDecoder.cpp + TimelineDecoder.hpp + TimelineDirectoryCaptureCommandHandler.cpp + TimelineDirectoryCaptureCommandHandler.hpp + ) + +include_directories(../timelineDecoder ../profiling) + +add_library_ex(timelineDecoder SHARED ${timelineDecoder_sources}) + +set_target_properties(timelineDecoder PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
\ No newline at end of file diff --git a/tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.cpp b/src/timelineDecoder/TimelineCaptureCommandHandler.cpp index 1fd0d4745a..01f55bd6d9 100644 --- a/tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.cpp +++ b/src/timelineDecoder/TimelineCaptureCommandHandler.cpp @@ -5,17 +5,16 @@ #include "TimelineCaptureCommandHandler.hpp" -#include <iostream> #include <string> namespace armnn { -namespace gatordmock +namespace timelinedecoder { //Array of member functions, the array index matches the decl_id -const TimelineCaptureCommandHandler::ReadFunction TimelineCaptureCommandHandler::m_ReadFunctions[5] +const TimelineCaptureCommandHandler::ReadFunction TimelineCaptureCommandHandler::m_ReadFunctions[] { &TimelineCaptureCommandHandler::ReadLabel, // Label decl_id = 0 &TimelineCaptureCommandHandler::ReadEntity, // Entity decl_id = 1 diff --git a/tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.hpp b/src/timelineDecoder/TimelineCaptureCommandHandler.hpp index 9cdbbdc32a..d95adc0321 100644 --- a/tests/profiling/timelineDecoder/TimelineCaptureCommandHandler.hpp +++ b/src/timelineDecoder/TimelineCaptureCommandHandler.hpp @@ -5,16 +5,16 @@ #pragma once -#include "ITimelineDecoder.hpp" - #include <CommandHandlerFunctor.hpp> +#include "armnn/profiling/ITimelineDecoder.hpp" + #include <Packet.hpp> #include <ProfilingUtils.hpp> namespace armnn { -namespace gatordmock +namespace timelinedecoder { class TimelineCaptureCommandHandler : public profiling::CommandHandlerFunctor diff --git a/tests/profiling/timelineDecoder/TimelineDecoder.cpp b/src/timelineDecoder/TimelineDecoder.cpp index 2924b7a287..fcf40b4522 100644 --- a/tests/profiling/timelineDecoder/TimelineDecoder.cpp +++ b/src/timelineDecoder/TimelineDecoder.cpp @@ -4,12 +4,13 @@ // #include "TimelineDecoder.hpp" - -#include <ProfilingUtils.hpp> +#include "../profiling/ProfilingUtils.hpp" #include <iostream> namespace armnn { +namespace timelinedecoder +{ TimelineDecoder::ErrorCode TimelineDecoder::CreateEntity(const Entity &entity) { if (m_OnNewEntityCallback == nullptr) @@ -282,4 +283,5 @@ void TimelineDecoder::printRelationships() std::cout << body; } } +} }
\ No newline at end of file diff --git a/tests/profiling/timelineDecoder/TimelineDecoder.hpp b/src/timelineDecoder/TimelineDecoder.hpp index 81e6a95c09..fc14603927 100644 --- a/tests/profiling/timelineDecoder/TimelineDecoder.hpp +++ b/src/timelineDecoder/TimelineDecoder.hpp @@ -4,10 +4,13 @@ // #pragma once -#include "ITimelineDecoder.hpp" +#include "armnn/profiling/ITimelineDecoder.hpp" #include <vector> + namespace armnn { +namespace timelinedecoder +{ class TimelineDecoder : public ITimelineDecoder { @@ -60,4 +63,6 @@ private: void printRelationships(); void printEvents(); }; + +} }
\ No newline at end of file diff --git a/tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp b/src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp index f28c7b50bf..655e461b8c 100644 --- a/tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp +++ b/src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.cpp @@ -5,8 +5,6 @@ #include "TimelineDirectoryCaptureCommandHandler.hpp" -#include <ProfilingUtils.hpp> - #include <iostream> #include <string> @@ -15,7 +13,7 @@ using namespace armnn::profiling; namespace armnn { -namespace gatordmock +namespace timelinedecoder { void TimelineDirectoryCaptureCommandHandler::ParseData(const armnn::profiling::Packet& packet) diff --git a/tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.hpp b/src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.hpp index 36a82b5510..b4e0fd2d7d 100644 --- a/tests/profiling/timelineDecoder/TimelineDirectoryCaptureCommandHandler.hpp +++ b/src/timelineDecoder/TimelineDirectoryCaptureCommandHandler.hpp @@ -5,7 +5,6 @@ #pragma once - #include <CommandHandlerFunctor.hpp> #include <Packet.hpp> #include <PacketBuffer.hpp> @@ -14,7 +13,7 @@ namespace armnn { -namespace gatordmock +namespace timelinedecoder { class TimelineDirectoryCaptureCommandHandler : public profiling::CommandHandlerFunctor diff --git a/tests/profiling/timelineDecoder/tests/TimelineTests.cpp b/src/timelineDecoder/tests/TimelineTests.cpp index 5d3c3eaea9..052a3f12ff 100644 --- a/tests/profiling/timelineDecoder/tests/TimelineTests.cpp +++ b/src/timelineDecoder/tests/TimelineTests.cpp @@ -3,9 +3,9 @@ // SPDX-License-Identifier: MIT // -#include "../TimelineCaptureCommandHandler.hpp" -#include "../TimelineDirectoryCaptureCommandHandler.hpp" -#include "timelineDecoder/TimelineDecoder.hpp" +#include <TimelineCaptureCommandHandler.hpp> +#include <TimelineDirectoryCaptureCommandHandler.hpp> +#include <TimelineDecoder.hpp> #include <CommandHandlerFunctor.hpp> #include <ProfilingService.hpp> @@ -18,6 +18,7 @@ BOOST_AUTO_TEST_SUITE(TimelineDecoderTests) using namespace armnn; +using namespace timelinedecoder; void SendTimelinePacketToCommandHandler(const unsigned char* packetBuffer, profiling::CommandHandlerFunctor &CommandHandler) @@ -83,7 +84,7 @@ BOOST_AUTO_TEST_CASE(TimelineDirectoryTest) profiling::PacketVersionResolver packetVersionResolver; - gatordmock::TimelineDirectoryCaptureCommandHandler timelineDirectoryCaptureCommandHandler( + TimelineDirectoryCaptureCommandHandler timelineDirectoryCaptureCommandHandler( 1, 0, packetVersionResolver.ResolvePacketVersion(1, 0).GetEncodedValue(), true); sendTimelinePacket->SendTimelineMessageDirectoryPackage(); @@ -151,12 +152,12 @@ BOOST_AUTO_TEST_CASE(TimelineCaptureTest) TimelineDecoder timelineDecoder; const TimelineDecoder::Model& model = timelineDecoder.GetModel(); - gatordmock::TimelineCaptureCommandHandler timelineCaptureCommandHandler( + TimelineCaptureCommandHandler timelineCaptureCommandHandler( 1, 1, packetVersionResolver.ResolvePacketVersion(1, 1).GetEncodedValue(), timelineDecoder, threadIdSize); BOOST_CHECK(timelineDecoder.SetEntityCallback(PushEntity) == ITimelineDecoder::ErrorCode::ErrorCode_Success); BOOST_CHECK( - timelineDecoder.SetEventClassCallback(PushEventClass )== ITimelineDecoder::ErrorCode::ErrorCode_Success); + timelineDecoder.SetEventClassCallback(PushEventClass) == ITimelineDecoder::ErrorCode::ErrorCode_Success); BOOST_CHECK(timelineDecoder.SetEventCallback(PushEvent) == ITimelineDecoder::ErrorCode::ErrorCode_Success); BOOST_CHECK(timelineDecoder.SetLabelCallback(PushLabel) == ITimelineDecoder::ErrorCode::ErrorCode_Success); BOOST_CHECK( diff --git a/tests/profiling/gatordmock/tests/GatordMockTests.cpp b/tests/profiling/gatordmock/tests/GatordMockTests.cpp index fecfce42d0..78c6f117ac 100644 --- a/tests/profiling/gatordmock/tests/GatordMockTests.cpp +++ b/tests/profiling/gatordmock/tests/GatordMockTests.cpp @@ -9,6 +9,7 @@ #include <GatordMockService.hpp> #include <PeriodicCounterCaptureCommandHandler.hpp> #include <StreamMetadataCommandHandler.hpp> + #include <TimelineDirectoryCaptureCommandHandler.hpp> #include <test/ProfilingMocks.hpp> @@ -127,7 +128,7 @@ BOOST_AUTO_TEST_CASE(GatorDMockEndToEnd) profiling::DirectoryCaptureCommandHandler directoryCaptureCommandHandler( 0, 2, packetVersionResolver.ResolvePacketVersion(0, 2).GetEncodedValue(), true); - gatordmock::TimelineDirectoryCaptureCommandHandler timelineDirectoryCaptureCommandHandler( + timelinedecoder::TimelineDirectoryCaptureCommandHandler timelineDirectoryCaptureCommandHandler( 1, 0, packetVersionResolver.ResolvePacketVersion(1, 0).GetEncodedValue(), true); // Register different derived functors |