aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2018-10-17 17:10:27 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:55:45 +0000
commit061dd36716a17c1065de6143f61e41d03896d541 (patch)
tree8b959d0da13357bd9d9f0f54c45ddf06cfa33e8f /src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
parented5a492ba791d8c8b3334749d4ae946b8f11d13d (diff)
downloadComputeLibrary-061dd36716a17c1065de6143f61e41d03896d541.tar.gz
COMPMID-1451: Fix allocation of weights in Deconvolution
Change-Id: If3ca0b034a7448df1e5349b51a2b124f1b4e99c1 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/153956 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: bsgcomp <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NEDeconvolutionLayer.cpp')
-rw-r--r--src/runtime/NEON/functions/NEDeconvolutionLayer.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp b/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
index cbe7c51662..23def5959b 100644
--- a/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
+++ b/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
@@ -39,6 +39,7 @@ NEDeconvolutionLayer::NEDeconvolutionLayer(std::shared_ptr<IMemoryManager> memor
_flip_weights(),
_scaled_output(),
_weights_flipped(),
+ _original_weights(nullptr),
_input(nullptr),
_info(),
_inner_border(),
@@ -104,10 +105,11 @@ void NEDeconvolutionLayer::configure(ITensor *input, const ITensor *weights, con
{
ARM_COMPUTE_ERROR_ON_NULLPTR(input, weights, output);
- _input = input;
- _info = info;
- _inner_border = std::make_pair(inner_border_right, inner_border_top);
- _is_prepared = false;
+ _input = input;
+ _original_weights = weights;
+ _info = info;
+ _inner_border = std::make_pair(inner_border_right, inner_border_top);
+ _is_prepared = false;
const unsigned int stride_x = info.stride().first;
const unsigned int stride_y = info.stride().second;
@@ -160,9 +162,21 @@ void NEDeconvolutionLayer::prepare()
{
if(!_is_prepared)
{
+ ARM_COMPUTE_ERROR_ON(!_original_weights->is_used());
+
+ // Run weights flipping and mark original weights tensor as unused
_weights_flipped.allocator()->allocate();
CPPScheduler::get().schedule(&_flip_weights, Window::DimZ);
+ _original_weights->mark_as_unused();
+
+ // Prepare convolution
_conv_f.prepare();
+
+ if(!_weights_flipped.is_used())
+ {
+ _weights_flipped.allocator()->free();
+ }
+
_is_prepared = true;
}
}