From 9d0b5f82c2734444145718f12788f2dde436ef45 Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Wed, 1 May 2019 13:03:59 +0100 Subject: COMPMID-2177 Fix clang warnings Change-Id: I78039db8c58d7b14a042c41e54c25fb9cb509bf7 Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/1092 Reviewed-by: VidhyaSudhan Loganathan Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- src/core/AccessWindowAutoPadding.cpp | 6 +++--- src/core/CL/kernels/CLComparisonKernel.cpp | 4 ++-- src/core/CL/kernels/CLElementwiseOperationKernel.cpp | 4 ++-- src/core/CL/kernels/CLGaussian5x5Kernel.cpp | 12 ++++++------ src/core/CL/kernels/CLGaussianPyramidKernel.cpp | 6 +++--- src/core/CL/kernels/CLMinMaxLayerKernel.cpp | 4 ++-- src/core/CPP/kernels/CPPUpsampleKernel.cpp | 2 +- src/core/Error.cpp | 11 ++++++----- src/core/GLES_COMPUTE/GCKernelLibrary.cpp | 6 +++--- src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp | 7 +++++-- src/core/NEON/kernels/NECropKernel.cpp | 2 +- src/core/NEON/kernels/NEDilateKernel.cpp | 5 +++-- src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp | 14 +++++++------- src/core/NEON/kernels/NEErodeKernel.cpp | 5 +++-- src/core/NEON/kernels/NEFillBorderKernel.cpp | 8 ++++---- src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp | 4 ++-- src/core/NEON/kernels/NELKTrackerKernel.cpp | 12 ++++++------ src/core/NEON/kernels/NEPoolingLayerKernel.cpp | 3 ++- src/core/NEON/kernels/NERemapKernel.cpp | 10 +++++----- src/core/NEON/kernels/NEScaleKernel.cpp | 5 ++++- src/core/utils/helpers/tensor_transform.cpp | 1 + src/core/utils/logging/LoggerRegistry.cpp | 4 ++-- 22 files changed, 73 insertions(+), 62 deletions(-) (limited to 'src/core') diff --git a/src/core/AccessWindowAutoPadding.cpp b/src/core/AccessWindowAutoPadding.cpp index 74af99bbb9..cfb36e1da1 100644 --- a/src/core/AccessWindowAutoPadding.cpp +++ b/src/core/AccessWindowAutoPadding.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -47,10 +47,10 @@ ValidRegion AccessWindowAutoPadding::compute_valid_region() const { if(_info == nullptr) { - return ValidRegion(); + return ValidRegion{}; } - return ValidRegion(Coordinates(), _info->tensor_shape()); + return ValidRegion{ Coordinates(), _info->tensor_shape() }; } void AccessWindowAutoPadding::set_valid_region() diff --git a/src/core/CL/kernels/CLComparisonKernel.cpp b/src/core/CL/kernels/CLComparisonKernel.cpp index f5f5a0fbd6..4f44851ef8 100644 --- a/src/core/CL/kernels/CLComparisonKernel.cpp +++ b/src/core/CL/kernels/CLComparisonKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -219,6 +219,6 @@ BorderSize CLComparisonKernel::border_size() const const unsigned int replicateSize = _output->info()->dimension(0) - std::min(_input1->info()->dimension(0), _input2->info()->dimension(0)); const unsigned int border = std::min(num_elems_processed_per_iteration - 1U, replicateSize); - return BorderSize(0, border, 0, 0); + return BorderSize{ 0, border, 0, 0 }; } } // namespace arm_compute diff --git a/src/core/CL/kernels/CLElementwiseOperationKernel.cpp b/src/core/CL/kernels/CLElementwiseOperationKernel.cpp index 37eeeb78bf..63c9244961 100644 --- a/src/core/CL/kernels/CLElementwiseOperationKernel.cpp +++ b/src/core/CL/kernels/CLElementwiseOperationKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 ARM Limited. + * Copyright (c) 2018-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -281,7 +281,7 @@ BorderSize CLElementwiseOperationKernel::border_size() const { const unsigned int replicateSize = _output->info()->dimension(0) - std::min(_input1->info()->dimension(0), _input2->info()->dimension(0)); const unsigned int border = std::min(num_elems_processed_per_iteration - 1U, replicateSize); - return BorderSize(0, border, 0, 0); + return BorderSize{ 0, border, 0, 0 }; } /** Arithmetic operations with saturation*/ diff --git a/src/core/CL/kernels/CLGaussian5x5Kernel.cpp b/src/core/CL/kernels/CLGaussian5x5Kernel.cpp index bd523c883d..3b45b07ed9 100644 --- a/src/core/CL/kernels/CLGaussian5x5Kernel.cpp +++ b/src/core/CL/kernels/CLGaussian5x5Kernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -29,17 +29,17 @@ using namespace arm_compute; void CLGaussian5x5HorKernel::configure(const ICLTensor *input, ICLTensor *output, bool border_undefined) { - const int16_t matrix[] = { 1, 4, 6, 4, 1 }; + const std::array matrix = { 1, 4, 6, 4, 1 }; // Set arguments - CLSeparableConvolution5x5HorKernel::configure(input, output, matrix, border_undefined); + CLSeparableConvolution5x5HorKernel::configure(input, output, matrix.data(), border_undefined); } void CLGaussian5x5VertKernel::configure(const ICLTensor *input, ICLTensor *output, bool border_undefined) { - const uint32_t scale = 256; - const int16_t matrix[] = { 1, 4, 6, 4, 1 }; + const uint32_t scale = 256; + const std::array matrix = { 1, 4, 6, 4, 1 }; // Set arguments - CLSeparableConvolution5x5VertKernel::configure(input, output, matrix, scale, border_undefined); + CLSeparableConvolution5x5VertKernel::configure(input, output, matrix.data(), scale, border_undefined); } diff --git a/src/core/CL/kernels/CLGaussianPyramidKernel.cpp b/src/core/CL/kernels/CLGaussianPyramidKernel.cpp index 6b729c8585..c9c7bf39a9 100644 --- a/src/core/CL/kernels/CLGaussianPyramidKernel.cpp +++ b/src/core/CL/kernels/CLGaussianPyramidKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -38,7 +38,7 @@ CLGaussianPyramidHorKernel::CLGaussianPyramidHorKernel() BorderSize CLGaussianPyramidHorKernel::border_size() const { - return BorderSize(0, 2); + return BorderSize{ 0, 2 }; } void CLGaussianPyramidHorKernel::configure(const ICLTensor *input, ICLTensor *output) @@ -130,7 +130,7 @@ CLGaussianPyramidVertKernel::CLGaussianPyramidVertKernel() BorderSize CLGaussianPyramidVertKernel::border_size() const { - return BorderSize(2, 0); + return BorderSize{ 2, 0 }; } void CLGaussianPyramidVertKernel::configure(const ICLTensor *input, ICLTensor *output) diff --git a/src/core/CL/kernels/CLMinMaxLayerKernel.cpp b/src/core/CL/kernels/CLMinMaxLayerKernel.cpp index fa7b678e86..92b5f8d505 100644 --- a/src/core/CL/kernels/CLMinMaxLayerKernel.cpp +++ b/src/core/CL/kernels/CLMinMaxLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -127,7 +127,7 @@ void CLMinMaxLayerKernel::reset(cl::CommandQueue &queue) Iterator output(_output, window_output); // Reset output - execute_window_loop(window_output, [&](const Coordinates & id) + execute_window_loop(window_output, [&](const Coordinates &) { auto *ptr = reinterpret_cast(output.ptr()); ptr[0] = std::numeric_limits::max(); diff --git a/src/core/CPP/kernels/CPPUpsampleKernel.cpp b/src/core/CPP/kernels/CPPUpsampleKernel.cpp index f04728d30d..d29c0f72f1 100644 --- a/src/core/CPP/kernels/CPPUpsampleKernel.cpp +++ b/src/core/CPP/kernels/CPPUpsampleKernel.cpp @@ -94,7 +94,7 @@ void CPPUpsampleKernel::run(const Window &window, const ThreadInfo &info) Iterator in(_input, window); Iterator out(_output, window_out); - execute_window_loop(window, [&](const Coordinates & id) + execute_window_loop(window, [&](const Coordinates &) { memcpy(out.ptr(), in.ptr(), element_size); }, diff --git a/src/core/Error.cpp b/src/core/Error.cpp index e7b43655a2..45cce66804 100644 --- a/src/core/Error.cpp +++ b/src/core/Error.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -23,6 +23,7 @@ */ #include "arm_compute/core/Error.h" +#include #include #include #include @@ -32,11 +33,11 @@ using namespace arm_compute; Status arm_compute::create_error_va_list(ErrorCode error_code, const char *function, const char *file, const int line, const char *msg, va_list args) { - char out[512]; - int offset = snprintf(out, sizeof(out), "in %s %s:%d: ", function, file, line); - vsnprintf(out + offset, sizeof(out) - offset, msg, args); + std::array out{ 0 }; + int offset = snprintf(out.data(), out.size(), "in %s %s:%d: ", function, file, line); + vsnprintf(out.data() + offset, out.size() - offset, msg, args); - return Status(error_code, std::string(out)); + return Status(error_code, std::string(out.data())); } Status arm_compute::create_error(ErrorCode error_code, const char *function, const char *file, const int line, const char *msg, ...) diff --git a/src/core/GLES_COMPUTE/GCKernelLibrary.cpp b/src/core/GLES_COMPUTE/GCKernelLibrary.cpp index 25ac02e8f4..0af8c7d4cc 100644 --- a/src/core/GLES_COMPUTE/GCKernelLibrary.cpp +++ b/src/core/GLES_COMPUTE/GCKernelLibrary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -387,7 +387,7 @@ GCKernel GCKernelLibrary::create_kernel(const std::string &shader_name, const St return kernel; } -const std::string GCKernelLibrary::preprocess_shader(const std::string &shader_source) const +std::string GCKernelLibrary::preprocess_shader(const std::string &shader_source) const { enum class ParserStage { @@ -399,7 +399,7 @@ const std::string GCKernelLibrary::preprocess_shader(const std::string &shader_s // Define a GLES compute shader parser function std::function cs_parser; - cs_parser = [&](const std::string & src, ParserStage stage, int nested_level) -> std::string + cs_parser = [&](const std::string & src, ParserStage stage, int) -> std::string { std::string dst; diff --git a/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp b/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp index f225ebde6b..50171a1015 100644 --- a/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp +++ b/src/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -333,7 +333,10 @@ void GCPoolingLayerKernel::run(const Window &window) ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(IKernel::window(), window); - unsigned int pool_pad_x, pool_pad_y, pool_stride_x, pool_stride_y = 0; + unsigned int pool_pad_x; + unsigned int pool_pad_y; + unsigned int pool_stride_x; + unsigned int pool_stride_y; std::tie(pool_pad_x, pool_pad_y) = _pool_info.pad_stride_info().pad(); std::tie(pool_stride_x, pool_stride_y) = _pool_info.pad_stride_info().stride(); diff --git a/src/core/NEON/kernels/NECropKernel.cpp b/src/core/NEON/kernels/NECropKernel.cpp index b6fe5819e4..f16eb3e6bd 100644 --- a/src/core/NEON/kernels/NECropKernel.cpp +++ b/src/core/NEON/kernels/NECropKernel.cpp @@ -178,7 +178,7 @@ inline void out_of_bounds_crop_window(const ITensor *output, float *output_ptr, template inline void execute_window(const ITensor *input, const ITensor *output, Coordinates input_offset, float extrapolation_value, - const uint32_t rows_out_of_bounds[], const uint32_t cols_out_of_bounds[], NECropKernel::InBoundsCropFunction *in_bounds_crop_function) + const std::array &rows_out_of_bounds, const std::array &cols_out_of_bounds, NECropKernel::InBoundsCropFunction *in_bounds_crop_function) { // Output is always float. const int window_step_x = 16 / sizeof(float); diff --git a/src/core/NEON/kernels/NEDilateKernel.cpp b/src/core/NEON/kernels/NEDilateKernel.cpp index 3ee00a47d3..e761815f9e 100644 --- a/src/core/NEON/kernels/NEDilateKernel.cpp +++ b/src/core/NEON/kernels/NEDilateKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -94,7 +94,8 @@ void NEDilateKernel::run(const Window &window, const ThreadInfo &info) uint8x8_t bot_high_data = vget_high_u8(bot_data); uint8x8_t bot_low_data = vget_low_u8(bot_data); - uint8x8_t p0, p1; + uint8x8_t p0; + uint8x8_t p1; p0 = top_low_data; p1 = vext_u8(top_low_data, top_high_data, 1); diff --git a/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp b/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp index 162c4b1ace..d557cfa1bd 100644 --- a/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp +++ b/src/core/NEON/kernels/NEDirectConvolutionLayerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -192,12 +192,12 @@ public: execute_window_loop(window_out, [&](const Coordinates & id) { - const uint8_t *input_ptr = in.ptr() - conv_pad_left * input_stride_x - conv_pad_top * input_stride_y; - uint8_t *out_ptr = out.ptr(); - int ih = 0; - int oh = 0; - float32x4_t accum0[small_tensor_size_optim] = { vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0) }; - float32x4_t accum1[small_tensor_size_optim] = { vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0) }; + const uint8_t *input_ptr = in.ptr() - conv_pad_left * input_stride_x - conv_pad_top * input_stride_y; + uint8_t *out_ptr = out.ptr(); + int ih = 0; + int oh = 0; + std::array accum0 = { vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0) }; + std::array accum1 = { vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0), vdupq_n_f32(0) }; for(int oz = 0; oz < range_z; ++oz) { accum0[0] = accum0[1] = accum0[2] = accum0[3] = accum0[4] = accum0[5] = accum0[6] = accum0[7] = vdupq_n_f32(0.f); diff --git a/src/core/NEON/kernels/NEErodeKernel.cpp b/src/core/NEON/kernels/NEErodeKernel.cpp index 88c20f8174..2a538ecd0f 100644 --- a/src/core/NEON/kernels/NEErodeKernel.cpp +++ b/src/core/NEON/kernels/NEErodeKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -94,7 +94,8 @@ void NEErodeKernel::run(const Window &window, const ThreadInfo &info) uint8x8_t bot_high_data = vget_high_u8(bot_data); uint8x8_t bot_low_data = vget_low_u8(bot_data); - uint8x8_t p0, p1; + uint8x8_t p0; + uint8x8_t p1; p0 = top_low_data; p1 = vext_u8(top_low_data, top_high_data, 1); diff --git a/src/core/NEON/kernels/NEFillBorderKernel.cpp b/src/core/NEON/kernels/NEFillBorderKernel.cpp index f4046e0851..4127dc8fbd 100644 --- a/src/core/NEON/kernels/NEFillBorderKernel.cpp +++ b/src/core/NEON/kernels/NEFillBorderKernel.cpp @@ -168,7 +168,7 @@ void NEFillBorderKernel::fill_replicate_single_channel(const Window &window) Iterator vertical_it(_tensor, vertical); - execute_window_loop(vertical, [&](const Coordinates & id) + execute_window_loop(vertical, [&](const Coordinates &) { uint8_t *base_addr = start_valid_region + vertical_it.offset(); // Fill left and right borders @@ -188,7 +188,7 @@ void NEFillBorderKernel::fill_replicate_single_channel(const Window &window) Iterator plane_it(_tensor, window); // Iterate over all XY planes - execute_window_loop(window, [&](const Coordinates & id) + execute_window_loop(window, [&](const Coordinates &) { uint8_t *base_addr = start_valid_region + plane_it.offset(); // Top border @@ -224,7 +224,7 @@ void NEFillBorderKernel::fill_constant_value_single_channel(const Window &window Iterator vertical_it(_tensor, vertical); - execute_window_loop(vertical, [&](const Coordinates & id) + execute_window_loop(vertical, [&](const Coordinates &) { uint8_t *base_addr = start_valid_region + vertical_it.offset(); // Fill left and right borders @@ -244,7 +244,7 @@ void NEFillBorderKernel::fill_constant_value_single_channel(const Window &window Iterator plane_it(_tensor, window); // Iterate over all XY planes - execute_window_loop(window, [&](const Coordinates & id) + execute_window_loop(window, [&](const Coordinates &) { uint8_t *base_addr = start_valid_region + plane_it.offset(); // Top border diff --git a/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp b/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp index 7769d9eb8c..c929983162 100644 --- a/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp +++ b/src/core/NEON/kernels/NEGEMMInterleave4x4Kernel.cpp @@ -126,7 +126,7 @@ void gemm_interleave_16bit_elements(const ITensor *input, ITensor *output, const win_out.set_dimension_step(Window::DimX, 16); Iterator out(output, win_out); - execute_window_loop(window, [&](const Coordinates & id) + execute_window_loop(window, [&](const Coordinates &) { const uint16x4x4_t data = { @@ -154,7 +154,7 @@ void gemm_interleave_32bit_elements(const ITensor *input, ITensor *output, const win_out.set_dimension_step(Window::DimX, 16); Iterator out(output, win_out); - execute_window_loop(window, [&](const Coordinates & id) + execute_window_loop(window, [&](const Coordinates &) { const uint32x4x4_t data = { diff --git a/src/core/NEON/kernels/NELKTrackerKernel.cpp b/src/core/NEON/kernels/NELKTrackerKernel.cpp index 83593e7f0d..ddf869e303 100644 --- a/src/core/NEON/kernels/NELKTrackerKernel.cpp +++ b/src/core/NEON/kernels/NELKTrackerKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 ARM Limited. + * Copyright (c) 2016-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -405,9 +405,9 @@ void NELKTrackerKernel::run(const Window &window, const ThreadInfo &info) init_keypoints(list_start, list_end); - const int buffer_size = _window_dimension * _window_dimension; - int32_t bilinear_ix[buffer_size]; - int32_t bilinear_iy[buffer_size]; + const int buffer_size = _window_dimension * _window_dimension; + std::vector bilinear_ix(buffer_size); + std::vector bilinear_iy(buffer_size); const int half_window = _window_dimension / 2; @@ -444,7 +444,7 @@ void NELKTrackerKernel::run(const Window &window, const ThreadInfo &info) int iA12 = 0; int iA22 = 0; - std::tie(iA11, iA12, iA22) = compute_spatial_gradient_matrix(old_keypoint, bilinear_ix, bilinear_iy); + std::tie(iA11, iA12, iA22) = compute_spatial_gradient_matrix(old_keypoint, bilinear_ix.data(), bilinear_iy.data()); const float A11 = iA11 * FLT_SCALE; const float A12 = iA12 * FLT_SCALE; @@ -490,7 +490,7 @@ void NELKTrackerKernel::run(const Window &window, const ThreadInfo &info) int ib1 = 0; int ib2 = 0; - std::tie(ib1, ib2) = compute_image_mismatch_vector(old_keypoint, new_keypoint, bilinear_ix, bilinear_iy); + std::tie(ib1, ib2) = compute_image_mismatch_vector(old_keypoint, new_keypoint, bilinear_ix.data(), bilinear_iy.data()); double b1 = ib1 * FLT_SCALE; double b2 = ib2 * FLT_SCALE; diff --git a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp index 0b90d9f290..ac2ffa1988 100644 --- a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp +++ b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp @@ -352,7 +352,8 @@ void NEPoolingLayerKernel::configure(const ITensor *input, ITensor *output, cons ARM_COMPUTE_ERROR_THROW_ON(validate_arguments_pool_info(pool_size.x(), pool_size.y())); // Check output dimensions - unsigned int pooled_w, pooled_h; + unsigned int pooled_w; + unsigned int pooled_h; std::tie(pooled_w, pooled_h) = scaled_dimensions(input->info()->dimension(idx_width), input->info()->dimension(idx_height), pool_size.x(), diff --git a/src/core/NEON/kernels/NERemapKernel.cpp b/src/core/NEON/kernels/NERemapKernel.cpp index edb3ffe1df..3c871de73a 100644 --- a/src/core/NEON/kernels/NERemapKernel.cpp +++ b/src/core/NEON/kernels/NERemapKernel.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -113,8 +113,8 @@ void NERemapKernel::configure(const ITensor *input, const ITensor *map_x, const AccessWindowStatic input_access(input->info(), -border_size().left, -border_size().top, access_right, input->info()->dimension(1) + border_size().bottom); AccessWindowHorizontal output_access(output->info(), 0, num_elems_processed_per_iteration); - AccessWindowHorizontal mapx_access(map_x->info(), 0, num_elems_processed_per_iteration); - AccessWindowHorizontal mapy_access(map_y->info(), 0, num_elems_processed_per_iteration); + AccessWindowHorizontal mapx_access(map_x->info(), 0, num_elems_processed_per_iteration); + AccessWindowHorizontal mapy_access(map_y->info(), 0, num_elems_processed_per_iteration); update_window_and_padding(win, input_access, mapx_access, mapy_access, output_access); @@ -140,7 +140,7 @@ void NERemapKernel::remap_nearest(const Window &window) const float32x4_t height = vdupq_n_f32(static_cast(_input->info()->dimension(1))); const int32x4_t in_stride = vdupq_n_s32(static_cast(_input->info()->strides_in_bytes()[1])); - execute_window_loop(window, [&](const Coordinates & id) + execute_window_loop(window, [&](const Coordinates &) { const auto mapx_ptr = reinterpret_cast(mapx.ptr()); const auto mapy_ptr = reinterpret_cast(mapy.ptr()); @@ -190,7 +190,7 @@ void NERemapKernel::remap_bilinear(const Window &window) const size_t height = _input->info()->dimension(1); const size_t in_stride = _input->info()->strides_in_bytes()[1]; - execute_window_loop(window, [&](const Coordinates & id) + execute_window_loop(window, [&](const Coordinates &) { const auto mapx_ptr = reinterpret_cast(mapx.ptr()); const auto mapy_ptr = reinterpret_cast(mapy.ptr()); diff --git a/src/core/NEON/kernels/NEScaleKernel.cpp b/src/core/NEON/kernels/NEScaleKernel.cpp index 8c4a70cdad..33540393e4 100644 --- a/src/core/NEON/kernels/NEScaleKernel.cpp +++ b/src/core/NEON/kernels/NEScaleKernel.cpp @@ -249,7 +249,10 @@ inline void scale_bilinear_nhwc_core(const ITensor *input, const ITensor *offset if(is_valid(offset, -border_size, input_width - 1 + border_size, in_yi, -border_size, input_height - 1 + border_size)) { - T a00 = 0, a01 = 0, a10 = 0, a11 = 0; + T a00 = 0; + T a01 = 0; + T a10 = 0; + T a11 = 0; if(border_mode == BorderMode::CONSTANT) { diff --git a/src/core/utils/helpers/tensor_transform.cpp b/src/core/utils/helpers/tensor_transform.cpp index 7c56390fed..f6a54a59ee 100644 --- a/src/core/utils/helpers/tensor_transform.cpp +++ b/src/core/utils/helpers/tensor_transform.cpp @@ -117,6 +117,7 @@ std::tuple calculate_strided_slice_coords Coordinates starts_abs{}; Coordinates ends_abs{}; Coordinates final_strides{}; + for(unsigned int i = 0; i < input_shape.num_dimensions(); ++i) { const int start_i = calculate_start_on_index(input_shape, i, starts, strides, begin_mask); diff --git a/src/core/utils/logging/LoggerRegistry.cpp b/src/core/utils/logging/LoggerRegistry.cpp index 3a466963fd..055e770c75 100644 --- a/src/core/utils/logging/LoggerRegistry.cpp +++ b/src/core/utils/logging/LoggerRegistry.cpp @@ -42,12 +42,12 @@ LoggerRegistry &LoggerRegistry::get() return _instance; } -void LoggerRegistry::create_logger(const std::string &name, LogLevel log_level, std::vector> printers) +void LoggerRegistry::create_logger(const std::string &name, LogLevel log_level, const std::vector> &printers) { std::lock_guard lock(_mtx); if((_loggers.find(name) == _loggers.end()) && (_reserved_loggers.find(name) == _reserved_loggers.end())) { - _loggers[name] = std::make_shared(name, log_level, std::move(printers)); + _loggers[name] = std::make_shared(name, log_level, printers); } } -- cgit v1.2.1