21.02
|
#include "ProfilingUtils.hpp"
#include "Runtime.hpp"
#include <armnn/BackendId.hpp>
#include <armnn/Optional.hpp>
#include <armnn/Types.hpp>
#include <BufferManager.hpp>
#include <ProfilingService.hpp>
Go to the source code of this file.
Classes | |
class | ProfilingServiceRuntimeHelper |
Namespaces | |
armnn | |
Copyright (c) 2021 ARM Limited and Contributors. | |
armnn::profiling | |
Functions | |
uint32_t | GetStreamMetaDataPacketSize () |
std::vector< BackendId > | GetSuitableBackendRegistered () |
Returns a vector of CpuRef, CpuAcc or GpuAcc backends if they where registered. More... | |
unsigned int | OffsetToNextWord (unsigned int numberOfBytes) |
void | VerifyTimelineHeaderBinary (const unsigned char *readableData, unsigned int &offset, uint32_t packetDataLength) |
ProfilingGuid | VerifyTimelineLabelBinaryPacketData (Optional< ProfilingGuid > guid, const std::string &label, const unsigned char *readableData, unsigned int &offset) |
void | VerifyTimelineEventClassBinaryPacketData (ProfilingGuid guid, ProfilingGuid nameGuid, const unsigned char *readableData, unsigned int &offset) |
void | VerifyTimelineRelationshipBinaryPacketData (ProfilingRelationshipType relationshipType, Optional< ProfilingGuid > relationshipGuid, Optional< ProfilingGuid > headGuid, Optional< ProfilingGuid > tailGuid, Optional< ProfilingGuid > attributeGuid, const unsigned char *readableData, unsigned int &offset) |
ProfilingGuid | VerifyTimelineEntityBinaryPacketData (Optional< ProfilingGuid > guid, const unsigned char *readableData, unsigned int &offset) |
ProfilingGuid | VerifyTimelineEventBinaryPacket (Optional< uint64_t > timestamp, Optional< int > threadId, Optional< ProfilingGuid > eventGuid, const unsigned char *readableData, unsigned int &offset) |
void | VerifyPostOptimisationStructureTestImpl (armnn::BackendId backendId) |
bool | CompareOutput (std::vector< std::string > output, std::vector< std::string > expectedOutput) |
bool CompareOutput | ( | std::vector< std::string > | output, |
std::vector< std::string > | expectedOutput | ||
) |
Definition at line 1258 of file ProfilingTestUtils.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
uint32_t GetStreamMetaDataPacketSize | ( | ) |
Definition at line 21 of file ProfilingTestUtils.cpp.
References armnn::profiling::GetHardwareVersion(), armnn::profiling::GetProcessName(), armnn::profiling::GetSoftwareInfo(), armnn::profiling::GetSoftwareVersion(), and armnn::numeric_cast().
Referenced by BOOST_AUTO_TEST_CASE().
std::vector<BackendId> GetSuitableBackendRegistered | ( | ) |
Returns a vector of CpuRef, CpuAcc or GpuAcc backends if they where registered.
Definition at line 41 of file ProfilingTestUtils.cpp.
References armnn::BackendRegistryInstance(), armnn::CpuAcc, armnn::CpuRef, armnn::GetComputeDeviceAsCString(), and armnn::GpuAcc.
Referenced by BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 59 of file ProfilingTestUtils.cpp.
References armnn::profiling::uint32_t_size.
Referenced by VerifyTimelineLabelBinaryPacketData().
void VerifyPostOptimisationStructureTestImpl | ( | armnn::BackendId | backendId | ) |
Definition at line 361 of file ProfilingTestUtils.cpp.
References LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS, LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS, LabelsAndEventClasses::BACKENDID_GUID, LabelsAndEventClasses::CHILD_GUID, IOutputSlot::Connect(), LabelsAndEventClasses::CONNECTION_GUID, INetwork::Create(), RuntimeImpl::EnqueueWorkload(), LabelsAndEventClasses::EXECUTION_OF_GUID, armnn::Float32, ProfilingServiceRuntimeHelper::ForceTransitionToState(), BackendId::Get(), armnnUtils::Processes::GetCurrentId(), RuntimeImpl::GetDeviceSpec(), IConnectableLayer::GetGuid(), IConnectableLayer::GetInputSlot(), RuntimeImpl::GetInputTensorInfo(), IConnectableLayer::GetOutputSlot(), RuntimeImpl::GetOutputTensorInfo(), ProfilingServiceRuntimeHelper::GetProfilingBufferManager(), armnn::GetProfilingService(), BufferManager::GetReadableBuffer(), LabelsAndEventClasses::INFERENCE_GUID, LabelsAndEventClasses::LAYER_GUID, RuntimeImpl::LoadNetwork(), Convolution2dDescriptor::m_BiasEnabled, IRuntime::CreationOptions::ExternalProfilingOptions::m_EnableProfiling, Convolution2dDescriptor::m_PadBottom, Convolution2dDescriptor::m_PadLeft, Convolution2dDescriptor::m_PadRight, Convolution2dDescriptor::m_PadTop, IRuntime::CreationOptions::m_ProfilingOptions, Convolution2dDescriptor::m_StrideX, Convolution2dDescriptor::m_StrideY, IRuntime::CreationOptions::ExternalProfilingOptions::m_TimelineEnabled, LabelsAndEventClasses::NAME_GUID, LabelsAndEventClasses::NETWORK_GUID, armnn::Optimize(), LabelsAndEventClasses::PROCESS_ID_GUID, ProfilingService::ResetExternalProfilingOptions(), IOutputSlot::SetTensorInfo(), armnn::Success, armnn::profiling::ThreadIdSize, LabelsAndEventClasses::TYPE_GUID, VerifyTimelineEntityBinaryPacketData(), VerifyTimelineEventBinaryPacket(), VerifyTimelineHeaderBinary(), VerifyTimelineLabelBinaryPacketData(), VerifyTimelineRelationshipBinaryPacketData(), LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID, and LabelsAndEventClasses::WORKLOAD_GUID.
Referenced by BOOST_AUTO_TEST_CASE().
ProfilingGuid VerifyTimelineEntityBinaryPacketData | ( | Optional< ProfilingGuid > | guid, |
const unsigned char * | readableData, | ||
unsigned int & | offset | ||
) |
Definition at line 267 of file ProfilingTestUtils.cpp.
References ARMNN_ASSERT, OptionalBase::has_value(), armnn::profiling::ReadUint32(), armnn::profiling::ReadUint64(), armnn::profiling::uint32_t_size, and OptionalReferenceSwitch< std::is_reference< T >::value, T >::value().
Referenced by BOOST_AUTO_TEST_CASE(), and VerifyPostOptimisationStructureTestImpl().
ProfilingGuid VerifyTimelineEventBinaryPacket | ( | Optional< uint64_t > | timestamp, |
Optional< int > | threadId, | ||
Optional< ProfilingGuid > | eventGuid, | ||
const unsigned char * | readableData, | ||
unsigned int & | offset | ||
) |
Definition at line 301 of file ProfilingTestUtils.cpp.
References ARMNN_ASSERT, armnnUtils::Threads::GetCurrentThreadId(), OptionalBase::has_value(), armnn::profiling::ReadBytes(), armnn::profiling::ReadUint32(), armnn::profiling::ReadUint64(), armnn::profiling::ThreadIdSize, armnn::profiling::uint32_t_size, and OptionalReferenceSwitch< std::is_reference< T >::value, T >::value().
Referenced by BOOST_AUTO_TEST_CASE(), and VerifyPostOptimisationStructureTestImpl().
void VerifyTimelineEventClassBinaryPacketData | ( | ProfilingGuid | guid, |
ProfilingGuid | nameGuid, | ||
const unsigned char * | readableData, | ||
unsigned int & | offset | ||
) |
Definition at line 145 of file ProfilingTestUtils.cpp.
References ARMNN_ASSERT, armnn::profiling::ReadUint32(), armnn::profiling::ReadUint64(), and armnn::profiling::uint32_t_size.
Referenced by BOOST_AUTO_TEST_CASE().
void VerifyTimelineHeaderBinary | ( | const unsigned char * | readableData, |
unsigned int & | offset, | ||
uint32_t | packetDataLength | ||
) |
Definition at line 72 of file ProfilingTestUtils.cpp.
References ARMNN_ASSERT, armnn::profiling::ReadUint32(), and armnn::profiling::uint32_t_size.
Referenced by BOOST_AUTO_TEST_CASE(), and VerifyPostOptimisationStructureTestImpl().
ProfilingGuid VerifyTimelineLabelBinaryPacketData | ( | Optional< ProfilingGuid > | guid, |
const std::string & | label, | ||
const unsigned char * | readableData, | ||
unsigned int & | offset | ||
) |
Definition at line 100 of file ProfilingTestUtils.cpp.
References ARMNN_ASSERT, ProfilingService::GetStaticId(), OptionalBase::has_value(), armnn::numeric_cast(), OffsetToNextWord(), armnn::profiling::ReadUint32(), armnn::profiling::ReadUint64(), armnn::profiling::uint32_t_size, and OptionalReferenceSwitch< std::is_reference< T >::value, T >::value().
Referenced by BOOST_AUTO_TEST_CASE(), and VerifyPostOptimisationStructureTestImpl().
void VerifyTimelineRelationshipBinaryPacketData | ( | ProfilingRelationshipType | relationshipType, |
Optional< ProfilingGuid > | relationshipGuid, | ||
Optional< ProfilingGuid > | headGuid, | ||
Optional< ProfilingGuid > | tailGuid, | ||
Optional< ProfilingGuid > | attributeGuid, | ||
const unsigned char * | readableData, | ||
unsigned int & | offset | ||
) |
Definition at line 173 of file ProfilingTestUtils.cpp.
References ARMNN_ASSERT, OptionalBase::has_value(), armnn::profiling::ReadUint32(), armnn::profiling::ReadUint64(), armnn::profiling::uint32_t_size, and OptionalReferenceSwitch< std::is_reference< T >::value, T >::value().
Referenced by BOOST_AUTO_TEST_CASE(), and VerifyPostOptimisationStructureTestImpl().