ArmNN
 20.02
FileOnlyProfilingDecoratorTests.cpp File Reference
#include "../FileOnlyProfilingConnection.hpp"
#include <ProfilingService.hpp>
#include <Runtime.hpp>
#include <Filesystem.hpp>
#include <armnn/utility/IgnoreUnused.hpp>
#include <boost/filesystem.hpp>
#include <boost/numeric/conversion/cast.hpp>
#include <boost/test/unit_test.hpp>
#include <cstdio>
#include <fstream>
#include <sstream>
#include <sys/stat.h>

Go to the source code of this file.

Functions

profilingService ResetExternalProfilingOptions (options, true)
 
profilingService Update ()
 
 BOOST_CHECK (profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
 
 while (profilingService.GetCurrentState() !=ProfilingState::Active &&packetCount< 3)
 
 BOOST_CHECK (boost::filesystem::exists(tempPath.c_str())==true)
 
 BOOST_CHECK (profilingService.IsCounterRegistered(0)==true)
 
profilingService IncrementCounterValue (0)
 
 BOOST_CHECK (profilingService.GetCounterValue(0) > 0)
 
helper WaitForPacketsSent ()
 
 BOOST_CHECK (armnnUtils::Filesystem::GetFileSize(tempPath.string().c_str()) > 0)
 
 BOOST_CHECK (armnnUtils::Filesystem::Remove(tempPath.string().c_str()))
 

Variables

boost::filesystem::path tempFile = boost::filesystem::unique_path()
 
 tempPath = tempPath / tempFile
 
armnn::Runtime::CreationOptions::ExternalProfilingOptions options
 
options m_EnableProfiling = true
 
options m_FileOnly = true
 
options m_IncomingCaptureFile = ""
 
options m_OutgoingCaptureFile = tempPath.string()
 
options m_CapturePeriod = 100
 
FileOnlyHelperService helper
 
ProfilingServiceprofilingService = ProfilingService::Instance()
 
uint32_t packetCount = 0
 

Function Documentation

◆ BOOST_CHECK() [1/6]

BOOST_CHECK ( profilingService.  GetCurrentState() = =ProfilingState::WaitingForAck)

Referenced by ArgMinMaxInferOutputShape1dTest(), ArgMinMaxInferOutputShape2dTest(), ArgMinMaxInferOutputShape3dTest(), ArgMinMaxInferOutputShape4dTest(), BatchToSpaceInferOutputShapeTest(), BOOST_AUTO_TEST_CASE(), armnn::BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), TestLayerVisitor::CheckConstTensors(), TestConvolution2dLayerVisitor::CheckDescriptor(), TestDepthwiseConvolution2dLayerVisitor::CheckDescriptor(), TestFullyConnectedLayerVistor::CheckDescriptor(), TestBatchNormalizationLayerVisitor::CheckDescriptor(), TestLstmLayerVisitor::CheckDescriptor(), TestLayerVisitor::CheckLayerName(), TestLayerVisitor::CheckLayerPointer(), TestLayerVisitor::CheckOptionalConstTensors(), ParserFlatbuffersFixture::CheckTensors(), Convolution2dInferOutputShapeTest(), DepthwiseConvolution2dInferOutputShapeTest(), GetBasePath(), GetSoftmaxProfilerJson(), GetTestFilePath(), PreluInferOutputShapeAlphaBiggerTest(), PreluInferOutputShapeInputBiggerTest(), PreluInferOutputShapeNoMatchTest(), PreluInferOutputShapeSameDimsTest(), QuantizedLstmEndToEnd(), QuantizedLstmInferOutputShapeTest(), RunSoftmaxProfilerJsonPrinterTest(), SendTimelinePacketToCommandHandler(), SpaceToDepthInferOutputShapeTest(), StackInferOutputShapeFromInputsMatchTest(), StackInferOutputShapeFromInputsNoMatchTest(), StringToSwTraceStringTestHelper(), SwapProfilingConnectionFactoryHelper::SwapProfilingConnectionFactoryHelper(), TransposeConvolution2dInferOutputShapeTest(), ValidateProfilerJson(), VerifyPostOptimisationStructureTestImpl(), VerifyTimelineEntityBinaryPacketData(), VerifyTimelineEventBinaryPacket(), VerifyTimelineEventClassBinaryPacketData(), VerifyTimelineHeaderBinary(), VerifyTimelineLabelBinaryPacketData(), VerifyTimelineRelationshipBinaryPacketData(), while(), and SwapProfilingConnectionFactoryHelper::~SwapProfilingConnectionFactoryHelper().

◆ BOOST_CHECK() [2/6]

BOOST_CHECK ( boost::filesystem::exists(tempPath.c_str())  = =true)

◆ BOOST_CHECK() [3/6]

BOOST_CHECK ( profilingService.  IsCounterRegistered0 = =true)

◆ BOOST_CHECK() [4/6]

BOOST_CHECK ( profilingService.  GetCounterValue0,
 
)

◆ BOOST_CHECK() [5/6]

BOOST_CHECK ( armnnUtils::Filesystem::GetFileSize(tempPath.string().c_str())  ,
 
)

◆ BOOST_CHECK() [6/6]

BOOST_CHECK ( armnnUtils::Filesystem::Remove(tempPath.string().c_str())  )

◆ IncrementCounterValue()

profilingService IncrementCounterValue ( )

◆ ResetExternalProfilingOptions()

profilingService ResetExternalProfilingOptions ( options  ,
true   
)

◆ Update()

profilingService Update ( )

◆ WaitForPacketsSent()

helper WaitForPacketsSent ( )

◆ while()

Variable Documentation

◆ helper

FileOnlyHelperService helper

Definition at line 52 of file FileOnlyProfilingDecoratorTests.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ m_CapturePeriod

◆ m_EnableProfiling

◆ m_FileOnly

options m_FileOnly = true

Definition at line 47 of file FileOnlyProfilingDecoratorTests.cpp.

◆ m_IncomingCaptureFile

options m_IncomingCaptureFile = ""

Definition at line 48 of file FileOnlyProfilingDecoratorTests.cpp.

◆ m_OutgoingCaptureFile

options m_OutgoingCaptureFile = tempPath.string()

Definition at line 49 of file FileOnlyProfilingDecoratorTests.cpp.

◆ options

◆ packetCount

uint32_t packetCount = 0

◆ profilingService

ProfilingService& profilingService = ProfilingService::Instance()

◆ tempFile

boost::filesystem::path tempFile = boost::filesystem::unique_path()

Definition at line 43 of file FileOnlyProfilingDecoratorTests.cpp.

◆ tempPath

tempPath = tempPath / tempFile

Definition at line 44 of file FileOnlyProfilingDecoratorTests.cpp.