From 6a3e976d71ecca2e6fdb604618fd94969eff9861 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 21 Sep 2017 13:30:40 +0100 Subject: COMPMID-417: Fix memory manager in NEDirectConvolution. Moves the accumulator manage call to the cases that is actually used. Change-Id: I80486913142860b394aad9d4b486166a2dfaf269 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/88620 Tested-by: Kaizen Reviewed-by: Moritz Pflanzer --- src/runtime/NEON/functions/NEDirectConvolutionLayer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/runtime/NEON/functions/NEDirectConvolutionLayer.cpp') diff --git a/src/runtime/NEON/functions/NEDirectConvolutionLayer.cpp b/src/runtime/NEON/functions/NEDirectConvolutionLayer.cpp index a56a73c44a..b831a6a7be 100644 --- a/src/runtime/NEON/functions/NEDirectConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEDirectConvolutionLayer.cpp @@ -46,15 +46,13 @@ void NEDirectConvolutionLayer::configure(ITensor *input, const ITensor *weights, _accumulator.allocator()->free(); } - // Manage intermediate buffers - _memory_group.manage(&_accumulator); - // Allocate the intermediate accumulator tensor in case of fixed point input switch(output->info()->data_type()) { case DataType::QS8: { _accumulator.allocator()->init(TensorInfo(output->info()->tensor_shape(), 1, DataType::QS16, output->info()->fixed_point_position())); + _memory_group.manage(&_accumulator); _conv_kernel.configure(input, weights, &_accumulator, conv_info); _accumulate_bias_kernel.configure(&_accumulator, bias, output); _accumulator.allocator()->allocate(); @@ -63,6 +61,7 @@ void NEDirectConvolutionLayer::configure(ITensor *input, const ITensor *weights, case DataType::QS16: { _accumulator.allocator()->init(TensorInfo(output->info()->tensor_shape(), 1, DataType::QS32, output->info()->fixed_point_position())); + _memory_group.manage(&_accumulator); _conv_kernel.configure(input, weights, &_accumulator, conv_info); _accumulate_bias_kernel.configure(&_accumulator, bias, output); _accumulator.allocator()->allocate(); -- cgit v1.2.1