aboutsummaryrefslogtreecommitdiff
path: root/src/backends
diff options
context:
space:
mode:
authorKevin May <kevin.may@arm.com>2021-10-18 14:41:50 +0100
committerKevin May <kevin.may@arm.com>2021-10-22 13:48:01 +0000
commit4692e11e5af29b97748a1585a092df6800a0a831 (patch)
treed6425d0c175572de834992d277c62278971d97cc /src/backends
parent7cf19105c227e3d4c6d7eee91e3828aeee228150 (diff)
downloadarmnn-4692e11e5af29b97748a1585a092df6800a0a831.tar.gz
IVGCVSW-6440 Print new Optimize and LoadedNetwork profiling points
* Add parent LoadedNetwork profiling point * Make generic populateParent function to print new descendents in json Signed-off-by: Kevin May <kevin.may@arm.com> Change-Id: I41dc876bffae88e61a16d07fb13b062c321e78a6
Diffstat (limited to 'src/backends')
-rw-r--r--src/backends/backendsCommon/test/JsonPrinterTestImpl.cpp7
-rw-r--r--src/backends/cl/workloads/ClConvolution2dWorkload.cpp29
2 files changed, 23 insertions, 13 deletions
diff --git a/src/backends/backendsCommon/test/JsonPrinterTestImpl.cpp b/src/backends/backendsCommon/test/JsonPrinterTestImpl.cpp
index a1128cfcb9..94855aa7b2 100644
--- a/src/backends/backendsCommon/test/JsonPrinterTestImpl.cpp
+++ b/src/backends/backendsCommon/test/JsonPrinterTestImpl.cpp
@@ -132,7 +132,6 @@ std::string GetSoftmaxProfilerJson(const std::vector<armnn::BackendId>& backends
// build up the structure of the network
INetworkPtr net(INetwork::Create());
-
IConnectableLayer* input = net->AddInputLayer(0, "input");
SoftmaxDescriptor softmaxDescriptor;
// Set Axis to -1 if CL or Neon until further Axes are supported.
@@ -158,7 +157,9 @@ std::string GetSoftmaxProfilerJson(const std::vector<armnn::BackendId>& backends
softmax->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
// optimize the network
- IOptimizedNetworkPtr optNet = Optimize(*net, backends, runtime->GetDeviceSpec());
+ armnn::OptimizerOptions optOptions;
+ optOptions.m_ProfilingEnabled = true;
+ IOptimizedNetworkPtr optNet = Optimize(*net, backends, runtime->GetDeviceSpec(), optOptions);
if(!optNet)
{
FAIL("Error occurred during Optimization, Optimize() returned nullptr.");
@@ -215,6 +216,8 @@ inline void ValidateProfilerJson(std::string& result)
{
if (sectionVector[i].find("\"ArmNN\":") != std::string::npos
+ || sectionVector[i].find("\"optimize_measurements\":") != std::string::npos
+ || sectionVector[i].find("\"loaded_network_measurements\":") != std::string::npos
|| sectionVector[i].find("\"inference_measurements\":") != std::string::npos)
{
sectionVector.erase(sectionVector.begin() + static_cast<int>(i));
diff --git a/src/backends/cl/workloads/ClConvolution2dWorkload.cpp b/src/backends/cl/workloads/ClConvolution2dWorkload.cpp
index 12a47dcd94..a5f4c7f254 100644
--- a/src/backends/cl/workloads/ClConvolution2dWorkload.cpp
+++ b/src/backends/cl/workloads/ClConvolution2dWorkload.cpp
@@ -70,6 +70,7 @@ ClConvolution2dWorkload::ClConvolution2dWorkload(const Convolution2dQueueDescrip
: BaseWorkload<Convolution2dQueueDescriptor>(descriptor, info)
, m_ConvolutionLayer(memoryManager)
{
+ ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClConvolution2dWorkload");
const TensorInfo& weightInfo = m_Data.m_Weight->GetTensorInfo();
m_KernelTensor = std::make_unique<arm_compute::CLTensor>();
@@ -97,16 +98,19 @@ ClConvolution2dWorkload::ClConvolution2dWorkload(const Convolution2dQueueDescrip
const arm_compute::ActivationLayerInfo activationInfo = ConvertAdditionalInfoToAclActivationLayerInfo(descriptor);
- m_ConvolutionLayer.configure(clCompileContext,
- &input,
- m_KernelTensor.get(),
- m_BiasTensor.get(),
- &output,
- padStrideInfo,
- arm_compute::WeightsInfo(),
- aclDilationInfo,
- activationInfo,
- isFastMathEnabled);
+ {
+ ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClConvolution2dWorkload_configure");
+ m_ConvolutionLayer.configure(clCompileContext,
+ &input,
+ m_KernelTensor.get(),
+ m_BiasTensor.get(),
+ &output,
+ padStrideInfo,
+ arm_compute::WeightsInfo(),
+ aclDilationInfo,
+ activationInfo,
+ isFastMathEnabled);
+ }
m_ConvolutionMethod =
m_ConvolutionLayer.get_convolution_method(input.info(),
@@ -146,7 +150,10 @@ ClConvolution2dWorkload::ClConvolution2dWorkload(const Convolution2dQueueDescrip
// Force Compute Library to perform the necessary copying and reshaping, after which
// delete all the input tensors that will no longer be needed
- m_ConvolutionLayer.prepare();
+ {
+ ARMNN_SCOPED_PROFILING_EVENT(Compute::Undefined, "ClConvolution2dWorkload_prepare");
+ m_ConvolutionLayer.prepare();
+ }
FreeUnusedTensors();
}