33 : m_BackendProfiling(
std::move(backendProfiling))
35 , m_IsTimelineEnabled(true)
42 return m_BackendProfiling;
47 std::unique_ptr<profiling::IRegisterBackendCounters> counterRegistrar =
48 m_BackendProfiling->GetCounterRegistrationInterface(static_cast<uint16_t>(currentMaxGlobalCounterId));
50 std::string categoryName(
"MockCounters");
51 counterRegistrar->RegisterCategory(categoryName);
53 counterRegistrar->RegisterCounter(0, categoryName, 0, 0, 1.f,
"Mock Counter One",
"Some notional counter");
55 counterRegistrar->RegisterCounter(1, categoryName, 0, 0, 1.f,
"Mock Counter Two",
56 "Another notional counter");
58 std::string units(
"microseconds");
59 uint16_t nextMaxGlobalCounterId =
60 counterRegistrar->RegisterCounter(2, categoryName, 0, 0, 1.f,
"Mock MultiCore Counter",
61 "A dummy four core counter", units, 4);
62 return nextMaxGlobalCounterId;
67 if (capturePeriod == 0 || counterIds.size() == 0)
69 m_ActiveCounters.clear();
71 else if (capturePeriod == 15939u)
75 m_CapturePeriod = capturePeriod;
76 m_ActiveCounters = counterIds;
82 std::vector<profiling::CounterValue> counterValues;
84 for (
auto counterId : m_ActiveCounters)
89 uint64_t timestamp = m_CapturePeriod;
95 auto sendTimelinePacket = m_BackendProfiling->GetSendTimelinePacket();
96 sendTimelinePacket->SendTimelineEntityBinaryPacket(4256);
97 sendTimelinePacket->Commit();
103 m_IsTimelineEnabled = isEnabled;
109 return m_IsTimelineEnabled;
114 uint32_t m_CapturePeriod;
115 std::vector<uint16_t> m_ActiveCounters;
116 std::atomic<bool> m_IsTimelineEnabled;
131 return m_sharedContext.get();
136 m_sharedContext = shared;
140 std::shared_ptr<MockBackendProfilingContext> m_sharedContext;
152 return GetIdStatic();
169 std::unique_ptr<ICustomAllocator> GetDefaultAllocator()
const override;
176 const std::vector<TensorInfo>& infos,
192 if (infos.size() != 4)
195 "TensorInfos. TensorInfos should be of format: " 196 "{input, output, weights, biases}.");
199 auto desc = *(PolymorphicDowncast<const Convolution2dDescriptor*>(&descriptor));
207 reasonIfUnsupported);
216 reasonIfUnsupported);
MockBackendProfilingContext(IBackendInternal::IBackendProfilingPtr &backendProfiling)
bool IsOutputSupported(const BackendId &backend, const TensorInfo &output, char *reasonIfUnsupported=nullptr, size_t reasonIfUnsupportedMaxLength=1024)
Deprecated in favor of IBackend and ILayerSupport interfaces.
std::unique_ptr< IWorkloadFactory > IWorkloadFactoryPtr
void SetProfilingContextPtr(std::shared_ptr< MockBackendProfilingContext > shared)
bool IsOutputSupported(const TensorInfo &, Optional< std::string &>) const override
~MockBackendInitialiser()
A Convolution2dDescriptor for the Convolution2dLayer.
bool IsInputSupported(const TensorInfo &, Optional< std::string &>) const override
Copyright (c) 2021 ARM Limited and Contributors.
std::unique_ptr< IMemoryManager > IMemoryManagerUniquePtr
const BackendId & GetId() const override
Base class for all descriptors.
The SubgraphView class represents a subgraph of a Graph.
Optional< std::string > ActivateCounters(uint32_t capturePeriod, const std::vector< uint16_t > &counterIds)
std::unique_ptr< armnn::profiling::IBackendProfiling > IBackendProfilingPtr
std::shared_ptr< IMemoryManager > IMemoryManagerSharedPtr
bool IsConvolution2dSupported(const TensorInfo &, const TensorInfo &, const Convolution2dDescriptor &, const TensorInfo &, const Optional< TensorInfo > &, Optional< std::string &>) const override
static MockBackendProfilingService & Instance()
bool IsConvolution2dSupported(const BackendId &backend, const TensorInfo &input, const TensorInfo &output, const Convolution2dDescriptor &descriptor, const TensorInfo &weights, const Optional< TensorInfo > &biases, char *reasonIfUnsupported=nullptr, size_t reasonIfUnsupportedMaxLength=1024)
Deprecated in favor of IBackend and ILayerSupport interfaces.
bool IsAdditionSupported(const TensorInfo &, const TensorInfo &, const TensorInfo &, Optional< std::string &>) const override
std::shared_ptr< ILayerSupport > ILayerSupportSharedPtr
bool EnableProfiling(bool)
bool IsInputSupported(const BackendId &backend, const TensorInfo &input, char *reasonIfUnsupported=nullptr, size_t reasonIfUnsupportedMaxLength=1024)
Deprecated in favor of IBackend and ILayerSupport interfaces.
MockBackendProfilingContext * GetContext()
EmptyOptional is used to initialize the Optional class in case we want to have default value for an O...
bool TimelineReportingEnabled()
std::vector< profiling::Timestamp > ReportCounterValues()
IBackendInternal::IBackendProfilingPtr & GetBackendProfiling()
bool IsAdditionSupported(const BackendId &backend, const TensorInfo &input0, const TensorInfo &input1, const TensorInfo &output, char *reasonIfUnsupported=nullptr, size_t reasonIfUnsupportedMaxLength=1024)
Deprecated in favor of IBackend and ILayerSupport interfaces.
bool EnableTimelineReporting(bool isEnabled)
bool IsLayerSupported(const LayerType &type, const std::vector< TensorInfo > &infos, const BaseDescriptor &descriptor, const Optional< LstmInputParamsInfo > &, const Optional< QuantizedLstmInputParamsInfo > &, Optional< std::string &> reasonIfUnsupported) const override
std::shared_ptr< armnn::profiling::IBackendProfilingContext > IBackendProfilingContextPtr
This is the bridge between backend and backend profiling we'll keep it in the backend namespace...
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below...
uint16_t RegisterCounters(uint16_t currentMaxGlobalCounterId)
std::unique_ptr< IBackendContext > IBackendContextPtr