aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2022-03-20 21:52:17 +0000
committerJim Flynn <jim.flynn@arm.com>2022-03-23 20:32:03 +0000
commit277618302d0f131eac0b6ac2015dd3eb09aa6ff9 (patch)
treee468fa1362640484b508812596fb5c1b62186882 /include
parenta3bc0b4976395226c0fa0898b26098c4534edbdb (diff)
downloadarmnn-277618302d0f131eac0b6ac2015dd3eb09aa6ff9.tar.gz
IVGCVSW-6706 Move headers to profiling/client/include
!android-nn-driver:7337 Change-Id: Ide401623829cc99fb9b51e9bbce3482ce706a8dd Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/armnn/IRuntime.hpp6
-rw-r--r--include/armnn/backends/IBackendInternal.hpp5
-rw-r--r--include/armnn/backends/Workload.hpp3
-rw-r--r--include/armnn/backends/profiling/IBackendProfiling.hpp106
-rw-r--r--include/armnn/backends/profiling/IBackendProfilingContext.hpp30
-rw-r--r--include/armnn/profiling/ILocalPacketHandler.hpp66
-rw-r--r--include/armnn/profiling/ISendTimelinePacket.hpp61
-rw-r--r--include/armnn/profiling/ProfilingOptions.hpp45
8 files changed, 9 insertions, 313 deletions
diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp
index debb2d6896..0a2dc3233e 100644
--- a/include/armnn/IRuntime.hpp
+++ b/include/armnn/IRuntime.hpp
@@ -12,10 +12,12 @@
#include "Tensor.hpp"
#include "Types.hpp"
#include "TypesUtils.hpp"
-#include "profiling/ILocalPacketHandler.hpp"
#include <armnn/backends/ICustomAllocator.hpp>
#include <armnn/backends/IMemoryOptimizerStrategy.hpp>
+
+#include <client/include/ILocalPacketHandler.hpp>
+
#include <memory>
#include <map>
@@ -31,7 +33,7 @@ class IRuntime;
using IRuntimePtr = std::unique_ptr<IRuntime, void(*)(IRuntime* runtime)>;
struct INetworkProperties
-{
+{
INetworkProperties(bool asyncEnabled,
MemorySource inputSource,
MemorySource outputSource,
diff --git a/include/armnn/backends/IBackendInternal.hpp b/include/armnn/backends/IBackendInternal.hpp
index 06fa5edde8..98f0eaacd7 100644
--- a/include/armnn/backends/IBackendInternal.hpp
+++ b/include/armnn/backends/IBackendInternal.hpp
@@ -16,8 +16,9 @@
#include <armnn/backends/ITensorHandleFactory.hpp>
#include <armnn/backends/OptimizationViews.hpp>
#include <armnn/backends/SubgraphView.hpp>
-#include <armnn/backends/profiling/IBackendProfiling.hpp>
-#include <armnn/backends/profiling/IBackendProfilingContext.hpp>
+
+#include <client/include/backends/IBackendProfiling.hpp>
+#include <client/include/backends/IBackendProfilingContext.hpp>
#include <vector>
#include <memory>
diff --git a/include/armnn/backends/Workload.hpp b/include/armnn/backends/Workload.hpp
index e180577ffe..d426486f89 100644
--- a/include/armnn/backends/Workload.hpp
+++ b/include/armnn/backends/Workload.hpp
@@ -12,7 +12,8 @@
#include <armnn/Logging.hpp>
#include <Profiling.hpp>
-#include <IProfilingService.hpp>
+
+#include <client/include/IProfilingService.hpp>
#include <algorithm>
diff --git a/include/armnn/backends/profiling/IBackendProfiling.hpp b/include/armnn/backends/profiling/IBackendProfiling.hpp
deleted file mode 100644
index 9affab2ade..0000000000
--- a/include/armnn/backends/profiling/IBackendProfiling.hpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// Copyright © 2020 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-#pragma once
-
-#include <armnn/profiling/ISendTimelinePacket.hpp>
-
-#include <common/include/IProfilingGuidGenerator.hpp>
-#include <common/include/Optional.hpp>
-
-#include <memory>
-#include <vector>
-
-namespace arm
-{
-
-namespace pipe
-{
-
-struct CounterValue
-{
- CounterValue(uint16_t id, uint32_t value) :
- counterId(id), counterValue(value) {}
- uint16_t counterId;
- uint32_t counterValue;
-};
-
-struct Timestamp
-{
- uint64_t timestamp;
- std::vector<CounterValue> counterValues;
-};
-
-struct CounterStatus
-{
- CounterStatus(uint16_t backendCounterId,
- uint16_t globalCounterId,
- bool enabled,
- uint32_t samplingRateInMicroseconds)
- : m_BackendCounterId(backendCounterId),
- m_GlobalCounterId(globalCounterId),
- m_Enabled(enabled),
- m_SamplingRateInMicroseconds(samplingRateInMicroseconds) {}
- uint16_t m_BackendCounterId;
- uint16_t m_GlobalCounterId;
- bool m_Enabled;
- uint32_t m_SamplingRateInMicroseconds;
-};
-
-class IRegisterBackendCounters
-{
-public:
- virtual void RegisterCategory(const std::string& categoryName) = 0;
-
- virtual uint16_t RegisterDevice(const std::string& deviceName,
- uint16_t cores = 0,
- const arm::pipe::Optional<std::string>& parentCategoryName
- = arm::pipe::EmptyOptional()) = 0;
-
- virtual uint16_t RegisterCounterSet(const std::string& counterSetName,
- uint16_t count = 0,
- const arm::pipe::Optional<std::string>& parentCategoryName
- = arm::pipe::EmptyOptional()) = 0;
-
- virtual uint16_t RegisterCounter(const uint16_t uid,
- const std::string& parentCategoryName,
- uint16_t counterClass,
- uint16_t interpolation,
- double multiplier,
- const std::string& name,
- const std::string& description,
- const arm::pipe::Optional<std::string>& units = arm::pipe::EmptyOptional(),
- const arm::pipe::Optional<uint16_t>& numberOfCores = arm::pipe::EmptyOptional(),
- const arm::pipe::Optional<uint16_t>& deviceUid = arm::pipe::EmptyOptional(),
- const arm::pipe::Optional<uint16_t>& counterSetUid = arm::pipe::EmptyOptional()) = 0;
-
- virtual ~IRegisterBackendCounters() {}
-};
-
-class IBackendProfiling
-{
-public:
- virtual ~IBackendProfiling()
- {}
-
- virtual std::unique_ptr<IRegisterBackendCounters>
- GetCounterRegistrationInterface(uint16_t currentMaxGlobalCounterID) = 0;
-
- virtual std::unique_ptr<ISendTimelinePacket> GetSendTimelinePacket() = 0;
-
- virtual IProfilingGuidGenerator& GetProfilingGuidGenerator() = 0;
-
- virtual void ReportCounters(const std::vector<Timestamp>& counterValues) = 0;
-
- virtual CounterStatus GetCounterStatus(uint16_t backendCounterId) = 0;
-
- virtual std::vector<CounterStatus> GetActiveCounters() = 0;
-
- virtual bool IsProfilingEnabled() const = 0;
-
-};
-
-} // namespace pipe
-
-} // namespace arm
diff --git a/include/armnn/backends/profiling/IBackendProfilingContext.hpp b/include/armnn/backends/profiling/IBackendProfilingContext.hpp
deleted file mode 100644
index a1ed05e43d..0000000000
--- a/include/armnn/backends/profiling/IBackendProfilingContext.hpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// Copyright © 2020 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-#pragma once
-
-#include "IBackendProfiling.hpp"
-#include <vector>
-
-namespace arm
-{
-namespace pipe
-{
-
-class IBackendProfilingContext
-{
-public:
- virtual ~IBackendProfilingContext()
- {}
- virtual uint16_t RegisterCounters(uint16_t currentMaxGlobalCounterID) = 0;
- virtual arm::pipe::Optional<std::string> ActivateCounters(
- uint32_t capturePeriod, const std::vector<uint16_t>& counterIds) = 0;
- virtual std::vector<Timestamp> ReportCounterValues() = 0;
- virtual bool EnableProfiling(bool flag) = 0;
- virtual bool EnableTimelineReporting(bool flag) = 0;
-};
-
-using IBackendProfilingContextUniquePtr = std::unique_ptr<IBackendProfilingContext>;
-} // namespace pipe
-} // namespace arm
diff --git a/include/armnn/profiling/ILocalPacketHandler.hpp b/include/armnn/profiling/ILocalPacketHandler.hpp
deleted file mode 100644
index bf7bdbc5c4..0000000000
--- a/include/armnn/profiling/ILocalPacketHandler.hpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// Copyright © 2020 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-
-#pragma once
-
-
-#include <armnn/utility/IgnoreUnused.hpp>
-#include "../../../profiling/common/include/TargetEndianess.hpp"
-
-#include <cstdint>
-#include <memory>
-#include <vector>
-
-// forward declare to prevent a circular dependency
-namespace arm
-{
-namespace pipe
-{
-
-class Packet;
-
-// the handlers need to be able to do two
-// things to service the FileOnlyProfilingConnection
-// and any other implementation of IProfilingConnection
-// set the endianness and write a packet back i.e.
-// return a packet and close the connection
-class IInternalProfilingConnection
-{
-public:
- virtual ~IInternalProfilingConnection() {};
-
- virtual void SetEndianess(const TargetEndianness& endianness) = 0;
-
- virtual void ReturnPacket(Packet& packet) = 0;
-
- virtual void Close() = 0;
-};
-
-class ILocalPacketHandler
-{
-public:
- virtual ~ILocalPacketHandler() {};
-
- /// @return lists the headers of the packets that this handler accepts
- /// only these packets will get sent to this handler.
- /// If this function returns an empty list then ALL packets
- /// will be sent to the PacketHandler i.e. a universal handler.
- virtual std::vector<uint32_t> GetHeadersAccepted() = 0;
-
- /// process the packet
- virtual void HandlePacket(const Packet& packet) = 0;
-
- /// Set a profiling connection on the handler. Only need to implement this
- /// function if the handler will be writing data back to the profiled application.
- virtual void SetConnection(IInternalProfilingConnection* profilingConnection)
- {armnn::IgnoreUnused(profilingConnection);}
-};
-
-using ILocalPacketHandlerPtr = std::unique_ptr<ILocalPacketHandler>;
-using ILocalPacketHandlerSharedPtr = std::shared_ptr<ILocalPacketHandler>;
-
-} // namespace pipe
-
-} // namespace arm \ No newline at end of file
diff --git a/include/armnn/profiling/ISendTimelinePacket.hpp b/include/armnn/profiling/ISendTimelinePacket.hpp
deleted file mode 100644
index 4785e04ef8..0000000000
--- a/include/armnn/profiling/ISendTimelinePacket.hpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-// Copyright © 2019 Arm Ltd and Contributors. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-
-#pragma once
-
-#include <algorithm>
-#include <string>
-#include <vector>
-
-namespace arm
-{
-
-namespace pipe
-{
-
-enum class ProfilingRelationshipType
-{
- RetentionLink, /// Head retains(parents) Tail
- ExecutionLink, /// Head execution start depends on Tail execution completion
- DataLink, /// Head uses data of Tail
- LabelLink /// Head uses label Tail (Tail MUST be a guid of a label).
-};
-
-class ISendTimelinePacket
-{
-public:
- virtual ~ISendTimelinePacket()
- {}
-
- /// Commits the current buffer and reset the member variables
- virtual void Commit() = 0;
-
- /// Create and write a TimelineEntityBinaryPacket from the parameters to the buffer.
- virtual void SendTimelineEntityBinaryPacket(uint64_t profilingGuid) = 0;
-
- /// Create and write a TimelineEventBinaryPacket from the parameters to the buffer.
- virtual void
- SendTimelineEventBinaryPacket(uint64_t timestamp, int threadId, uint64_t profilingGuid) = 0;
-
- /// Create and write a TimelineEventClassBinaryPacket from the parameters to the buffer.
- virtual void SendTimelineEventClassBinaryPacket(uint64_t profilingGuid, uint64_t nameGuid) = 0;
-
- /// Create and write a TimelineLabelBinaryPacket from the parameters to the buffer.
- virtual void SendTimelineLabelBinaryPacket(uint64_t profilingGuid, const std::string& label) = 0;
-
- /// Create and write a TimelineMessageDirectoryPackage in the buffer
- virtual void SendTimelineMessageDirectoryPackage() = 0;
-
- /// Create and write a TimelineRelationshipBinaryPacket from the parameters to the buffer.
- virtual void SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType relationshipType,
- uint64_t relationshipGuid,
- uint64_t headGuid,
- uint64_t tailGuid,
- uint64_t attributeGuid) = 0;
-};
-
-} // namespace pipe
-
-} // namespace arm
diff --git a/include/armnn/profiling/ProfilingOptions.hpp b/include/armnn/profiling/ProfilingOptions.hpp
deleted file mode 100644
index 6b4472ca63..0000000000
--- a/include/armnn/profiling/ProfilingOptions.hpp
+++ /dev/null
@@ -1,45 +0,0 @@
-//
-// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-
-#pragma once
-
-#include <armnn/profiling/ILocalPacketHandler.hpp>
-
-#include <string>
-#include <vector>
-
-namespace arm
-{
-namespace pipe
-{
-/// The lowest performance data capture interval we support is 10 miliseconds.
-constexpr unsigned int LOWEST_CAPTURE_PERIOD = 10000u;
-
-struct ProfilingOptions {
- ProfilingOptions()
- : m_EnableProfiling(false), m_TimelineEnabled(false), m_OutgoingCaptureFile(""),
- m_IncomingCaptureFile(""), m_FileOnly(false), m_CapturePeriod(arm::pipe::LOWEST_CAPTURE_PERIOD),
- m_FileFormat("binary"), m_LocalPacketHandlers() {}
-
- /// Indicates whether external profiling is enabled or not.
- bool m_EnableProfiling;
- /// Indicates whether external timeline profiling is enabled or not.
- bool m_TimelineEnabled;
- /// Path to a file in which outgoing timeline profiling messages will be stored.
- std::string m_OutgoingCaptureFile;
- /// Path to a file in which incoming timeline profiling messages will be stored.
- std::string m_IncomingCaptureFile;
- /// Enable profiling output to file only.
- bool m_FileOnly;
- /// The duration at which captured profiling messages will be flushed.
- uint32_t m_CapturePeriod;
- /// The format of the file used for outputting profiling data.
- std::string m_FileFormat;
- std::vector <ILocalPacketHandlerSharedPtr> m_LocalPacketHandlers;
-};
-
-} // namespace pipe
-
-} // namespace arm