From d912fd8eaaa56aac90f2b0b118c76f24ba8efa02 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 27 Nov 2017 21:00:13 +0000 Subject: COMPMID-617: Add validation to NEON functions. Adds validation to: - NECol2Im - NEIm2Col Change-Id: I346298583a6985ea793f71bb4527aa216a5cd4b2 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/110835 Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com Reviewed-by: Michalis Spyrou Reviewed-by: Anthony Barbier --- src/runtime/NEON/functions/NECol2Im.cpp | 7 ++++++- src/runtime/NEON/functions/NEConvolutionLayer.cpp | 2 +- src/runtime/NEON/functions/NEIm2Col.cpp | 5 +++++ src/runtime/NEON/functions/NELocallyConnectedLayer.cpp | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/runtime/NEON/functions') diff --git a/src/runtime/NEON/functions/NECol2Im.cpp b/src/runtime/NEON/functions/NECol2Im.cpp index 2dc4ebd49a..2a923f3730 100644 --- a/src/runtime/NEON/functions/NECol2Im.cpp +++ b/src/runtime/NEON/functions/NECol2Im.cpp @@ -28,9 +28,14 @@ using namespace arm_compute; -void NECol2Im::configure(const ITensor *input, ITensor *output, std::pair convolved_dims) +void NECol2Im::configure(const ITensor *input, ITensor *output, const Size2D &convolved_dims) { auto k = arm_compute::support::cpp14::make_unique(); k->configure(input, output, convolved_dims); _kernel = std::move(k); } + +Error NECol2Im::validate(const ITensorInfo *input, const ITensorInfo *output, const Size2D &convolved_dims) +{ + return NECol2ImKernel::validate(input, output, convolved_dims); +} diff --git a/src/runtime/NEON/functions/NEConvolutionLayer.cpp b/src/runtime/NEON/functions/NEConvolutionLayer.cpp index 155f4e561a..865672e525 100644 --- a/src/runtime/NEON/functions/NEConvolutionLayer.cpp +++ b/src/runtime/NEON/functions/NEConvolutionLayer.cpp @@ -292,7 +292,7 @@ void NEConvolutionLayer::configure(const ITensor *input, const ITensor *weights, } _input_im2col_reshaped.allocator()->allocate(); - _output_col2im_kernel.configure(&_gemm_output, output, std::make_pair(conv_w, conv_h)); + _output_col2im_kernel.configure(&_gemm_output, output, Size2D(conv_w, conv_h)); _gemm_output.allocator()->allocate(); ARM_COMPUTE_ERROR_ON_MSG((output->info()->dimension(0) != conv_w) || (output->info()->dimension(1) != conv_h), "Output shape does not match the expected one"); diff --git a/src/runtime/NEON/functions/NEIm2Col.cpp b/src/runtime/NEON/functions/NEIm2Col.cpp index 4ed591523b..354415daa3 100644 --- a/src/runtime/NEON/functions/NEIm2Col.cpp +++ b/src/runtime/NEON/functions/NEIm2Col.cpp @@ -34,3 +34,8 @@ void NEIm2Col::configure(const ITensor *input, ITensor *output, const Size2D &ke k->configure(input, output, kernel_dims, conv_info, has_bias); _kernel = std::move(k); } + +Error NEIm2Col::validate(const ITensorInfo *input, const ITensorInfo *output, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias) +{ + return NEIm2ColKernel::validate(input, output, kernel_dims, conv_info, has_bias); +} diff --git a/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp b/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp index cb48598921..b29b796276 100644 --- a/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp +++ b/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp @@ -111,7 +111,7 @@ void NELocallyConnectedLayer::configure(const ITensor *input, const ITensor *wei _input_im2col_kernel.configure(input, &_input_im2col_reshaped, Size2D(kernel_width, kernel_height), conv_info, _has_bias); _weights_reshape_kernel.configure(weights, biases, &_weights_reshaped); _mm_kernel.configure(&_input_im2col_reshaped, &_weights_reshaped, &_gemm_output); - _output_col2im_kernel.configure(&_gemm_output, output, std::make_pair(conv_w, conv_h)); + _output_col2im_kernel.configure(&_gemm_output, output, Size2D(conv_w, conv_h)); // Allocate intermediate tensors _weights_reshaped.allocator()->allocate(); -- cgit v1.2.1