12 #include <boost/filesystem.hpp> 13 #include <boost/numeric/conversion/cast.hpp> 14 #include <boost/test/unit_test.hpp> 21 using namespace armnn;
40 std::time_t t = std::time(
nullptr);
42 std::strftime(mbstr,
sizeof(mbstr),
"%Y_%m_%d_%H_%M_%S_", std::localtime(&t));
59 boost::filesystem::path
tempPath = boost::filesystem::temp_directory_path();
79 IConnectableLayer* normalize = net->AddNormalizationLayer(descriptor,
"normalization");
103 boost::filesystem::path
tempPath = boost::filesystem::temp_directory_path();
106 armnn::Runtime::CreationOptions::ExternalProfilingOptions
options;
107 options.m_EnableProfiling =
true;
108 options.m_FileOnly =
true;
109 options.m_IncomingCaptureFile =
"";
110 options.m_OutgoingCaptureFile = tempPath.string();
111 options.m_CapturePeriod = 100;
119 profilingService.
Update();
120 profilingService.
Update();
125 profilingService.
Update();
132 if(!helper.WaitForPacketsSent())
134 BOOST_FAIL(
"Timeout waiting for packets");
141 BOOST_CHECK(boost::filesystem::exists(tempPath.c_str()) ==
true);
153 helper.WaitForPacketsSent();
156 options.m_EnableProfiling =
false;
BOOST_AUTO_TEST_SUITE(TensorflowLiteParser)
bool IsCounterRegistered(uint16_t counterUid) const override
std::shared_ptr< ILocalPacketHandler > ILocalPacketHandlerSharedPtr
uint32_t GetAbsoluteCounterValue(uint16_t counterUid) const override
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
CPU Execution: Reference C++ kernels.
ProfilingState GetCurrentState() const
virtual const IDeviceSpec & GetDeviceSpec() const override
std::string UniqueFileName()
BackendRegistry & BackendRegistryInstance()
Copyright (c) 2020 ARM Limited.
uint32_t IncrementCounterValue(uint16_t counterUid) override
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
virtual void SetTensorInfo(const TensorInfo &tensorInfo)=0
bool WaitForPacketSent(ProfilingService &instance, uint32_t timeout=1000)
uint32_t GetDeltaCounterValue(uint16_t counterUid) override
std::vector< armnn::profiling::ILocalPacketHandlerSharedPtr > m_LocalPacketHandlers
IOptimizedNetworkPtr Optimize(const INetwork &network, const std::vector< BackendId > &backendPreferences, const IDeviceSpec &deviceSpec, const OptimizerOptions &options=OptimizerOptions(), Optional< std::vector< std::string > &> messages=EmptyOptional())
Create an optimized version of the network.
bool Remove(const char *path)
boost::filesystem::path tempFile
long long GetFileSize(const char *path)
std::unique_ptr< IOptimizedNetwork, void(*)(IOptimizedNetwork *network)> IOptimizedNetworkPtr
void ResetExternalProfilingOptions(const ExternalProfilingOptions &options, bool resetProfilingService=false)
BOOST_AUTO_TEST_CASE(CheckConvolution2dLayer)
armnn::profiling::ProfilingService profilingService
BOOST_AUTO_TEST_SUITE_END()
virtual Status LoadNetwork(NetworkId &networkIdOut, IOptimizedNetworkPtr network) override
Loads a complete network into the Runtime.
helper WaitForPacketsSent()
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
virtual const IOutputSlot & GetOutputSlot(unsigned int index) const =0
Get the const output slot handle by slot index.
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
virtual int Connect(IInputSlot &destination)=0
armnn::Runtime::CreationOptions::ExternalProfilingOptions options
A NormalizationDescriptor for the NormalizationLayer.
ExternalProfilingOptions m_ProfilingOptions
FileOnlyHelperService helper
static INetworkPtr Create()