From 60692ce197e94275ffd246620795ea020a8ad8b5 Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Wed, 11 May 2022 17:01:50 +0100 Subject: IVGCVSW-6949 Remove use of member variables in RefDepthwiseConv2d workload * Fixes Segmentation fault in RefDepthwiseConvolution2d workload originated by IVGCVSW-6127 ConstTensorsAsInput DepthwiseConvolution2d Signed-off-by: Teresa Charlin Change-Id: I019377777ae384bcd193ecab7b8cdf8266e79f45 --- .../workloads/RefDepthwiseConvolution2dWorkload.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/backends/reference/workloads/RefDepthwiseConvolution2dWorkload.cpp b/src/backends/reference/workloads/RefDepthwiseConvolution2dWorkload.cpp index c1c3916292..22538d23c5 100644 --- a/src/backends/reference/workloads/RefDepthwiseConvolution2dWorkload.cpp +++ b/src/backends/reference/workloads/RefDepthwiseConvolution2dWorkload.cpp @@ -64,8 +64,6 @@ void RefDepthwiseConvolution2dWorkload::Execute() const void RefDepthwiseConvolution2dWorkload::ExecuteAsync(WorkingMemDescriptor &workingMemDescriptor) { - PostAllocationConfigure(workingMemDescriptor.m_Inputs, workingMemDescriptor.m_Outputs); - Execute(workingMemDescriptor.m_Inputs, workingMemDescriptor.m_Outputs); } @@ -73,22 +71,22 @@ void RefDepthwiseConvolution2dWorkload::Execute(std::vector inpu std::vector outputs) const { ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefDepthwiseConvolution2dWorkload_Execute"); - std::unique_ptr> pBiasDecoder{}; - - std::unique_ptr> inputDecoder = MakeDecoder(GetTensorInfo(inputs[0]), inputs[0]->Map()); - std::unique_ptr> OutputEncoder = MakeEncoder(GetTensorInfo(outputs[0]), outputs[0]->Map()); - const TensorShape& inputShape = GetTensorInfo(inputs[0]).GetShape(); + const TensorShape& inputShape = GetTensorInfo(inputs[0]).GetShape(); const TensorShape& outputShape = GetTensorInfo(outputs[0]).GetShape(); + const TensorShape& filterShape = GetTensorInfo(inputs[1]).GetShape(); - m_FilterDecoder->Reset(inputs[1]->Map()); + std::unique_ptr> inputDecoder = MakeDecoder(GetTensorInfo(inputs[0]), inputs[0]->Map()); + std::unique_ptr> outputEncoder = MakeEncoder(GetTensorInfo(outputs[0]), outputs[0]->Map()); + std::unique_ptr> filterDecoder = MakeDecoder(GetTensorInfo(inputs[1]), inputs[1]->Map()); + std::unique_ptr> biasDecoder{}; if (m_Data.m_Parameters.m_BiasEnabled) { - m_BiasDecoder->Reset(inputs[2]->Map()); + biasDecoder = MakeDecoder(GetTensorInfo(inputs[2]), inputs[2]->Map()); } - Convolve(inputShape, *inputDecoder, outputShape, *OutputEncoder, - m_FilterShape, *m_FilterDecoder, m_Data.m_Parameters.m_BiasEnabled, m_BiasDecoder.get(), + Convolve(inputShape, *inputDecoder, outputShape, *outputEncoder, + filterShape, *filterDecoder, m_Data.m_Parameters.m_BiasEnabled, biasDecoder.get(), m_Data.m_Parameters.m_DataLayout, m_Data.m_Parameters.m_PadTop, m_Data.m_Parameters.m_PadLeft, m_Data.m_Parameters.m_StrideX, m_Data.m_Parameters.m_StrideY, m_Data.m_Parameters.m_DilationX, -- cgit v1.2.1