aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-02-01 16:31:33 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:47:18 +0000
commitced7a8d0b4fe77d750a1e55883d5886ad9760f3b (patch)
tree3c47818c8111f48fe6e9c7e9109c93a6e2ae9a2c /src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
parent1d6d211ef31698bc1864007961522dfae7bda3db (diff)
downloadComputeLibrary-ced7a8d0b4fe77d750a1e55883d5886ad9760f3b.tar.gz
COMPMID-875: Deconvolution 4x4 not working
-Enforces the use of the ConvolutionLayer function in the DeconvolutionLayer. -Adds tests for 4x4 Deconvolution. -Alters the ConvolutionLayer validation to support even kernels. Change-Id: Id27e285f078e690b8dd58490dd8ea6d875b3cec6 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/118632 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NEDeconvolutionLayer.cpp')
-rw-r--r--src/runtime/NEON/functions/NEDeconvolutionLayer.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp b/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
index 7bce8a6b7c..b293fa080a 100644
--- a/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
+++ b/src/runtime/NEON/functions/NEDeconvolutionLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -33,11 +33,13 @@ using namespace arm_compute::misc::shape_calculator;
NEDeconvolutionLayer::NEDeconvolutionLayer(std::shared_ptr<IMemoryManager> memory_manager) // NOLINT
: _memory_group(std::move(memory_manager)),
+ _direct_conv_f(),
_conv_f(),
_scaled_output(),
_input(nullptr),
_info(),
- _inner_border()
+ _inner_border(),
+ _run_direct_convolution(false)
{
}
@@ -47,11 +49,12 @@ void NEDeconvolutionLayer::configure(ITensor *input, const ITensor *weights, con
ARM_COMPUTE_ERROR_ON_NULLPTR(output);
ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(input, 1, DataType::F32);
ARM_COMPUTE_ERROR_ON(weights->info()->dimension(0) != weights->info()->dimension(1));
- ARM_COMPUTE_ERROR_ON(weights->info()->dimension(0) != 1 && weights->info()->dimension(0) != 3 && weights->info()->dimension(0) != 5);
_input = input;
_info = info;
_inner_border = std::make_pair(inner_border_right, inner_border_top);
+ // FIXME: ConvolutionLayer Segfaults in GEMM assembly code for 1x1 convolutions
+ _run_direct_convolution = (weights->info()->dimension(0) == weights->info()->dimension(1)) && (weights->info()->dimension(0) == 1);
const unsigned int stride_x = info.stride().first;
const unsigned int stride_y = info.stride().second;
@@ -75,7 +78,9 @@ void NEDeconvolutionLayer::configure(ITensor *input, const ITensor *weights, con
// setup the function to convolve the upscaled output
const PadStrideInfo conv_info(1, 1, 0, 0, 0, 0, DimensionRoundingType::CEIL);
- _conv_f.configure(&_scaled_output, weights, bias, output, conv_info);
+ (_run_direct_convolution) ? _direct_conv_f.configure(&_scaled_output, weights, bias, output, conv_info) : _conv_f.configure(&_scaled_output, weights, bias, output, conv_info);
+
+ // Allocate auxiliary tensors
_scaled_output.allocator()->allocate();
}
@@ -92,7 +97,7 @@ void NEDeconvolutionLayer::run()
const int stride_x = _info.stride().first;
const int stride_y = _info.stride().second;
- std::fill_n(reinterpret_cast<float *>(_scaled_output.buffer()), _scaled_output.info()->tensor_shape().total_size(), 0.f);
+ std::fill_n(_scaled_output.buffer(), _scaled_output.info()->total_size(), 0);
// scaled_output is the input for the forward convolution. We copy the input elements to scaled_output
// and insert rows and columns with zeroes depending on the stride values.
@@ -113,6 +118,8 @@ void NEDeconvolutionLayer::run()
}
}
- _conv_f.run();
+ // Run convolution layer
+ (_run_direct_convolution) ? _direct_conv_f.run() : _conv_f.run();
+
_memory_group.release();
}