From 30f0215ba247c05a81e91ed420f14b686a3528f3 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 27 Sep 2017 11:20:48 +0100 Subject: COMPMID-417: Fix clang-tidy failures for 32-bit runs Change-Id: I2fbb6dda1c281627a4d64dce3b4c4d2ebaa8d022 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/89289 Reviewed-by: Pablo Tello Tested-by: Kaizen Reviewed-by: Anthony Barbier --- scripts/clang_tidy_rules.py | 10 +++++++++- src/core/CL/CLHelpers.cpp | 4 ++++ src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp | 11 +++++++++++ .../NEON/kernels/NELocallyConnectedMatrixMultiplyKernel.cpp | 1 + src/core/NEON/kernels/NENormalizationLayerKernel.cpp | 1 + src/core/NEON/kernels/NEPixelWiseMultiplicationKernel.cpp | 7 ++++--- 6 files changed, 30 insertions(+), 4 deletions(-) diff --git a/scripts/clang_tidy_rules.py b/scripts/clang_tidy_rules.py index 900413c90b..378e18eeff 100755 --- a/scripts/clang_tidy_rules.py +++ b/scripts/clang_tidy_rules.py @@ -14,8 +14,8 @@ def get_list_flags( filename, arch): if "tests/validation_old" in filename: flags.append("-DBOOST") flags.append("-DARM_COMPUTE_CPP_SCHEDULER=1") + flags.append("-DARM_COMPUTE_CL") if arch == "aarch64": - flags.append("-DARM_COMPUTE_CL") flags.append("-DARM_COMPUTE_ENABLE_FP16") return flags @@ -70,6 +70,7 @@ def filter_clang_tidy_lines( lines ): ("Error.cpp" in line and "do not define a C-style variadic function" in line) or ("NEMinMaxLocationKernel.cpp" in line and "move constructors should be marked noexcept" in line) or ("NEMinMaxLocationKernel.cpp" in line and "move assignment operators should be marked noexcept" in line) or + ("CLMinMaxLocationKernel.cpp" in line and "Forming reference to null pointer" in line) or ("PMUCounter.cpp" in line and "consider replacing 'long long' with 'int64'" in line) or ("Validation.cpp" in line and "parameter 'classified_labels' is unused" in line) or ("Validation.cpp" in line and "parameter 'expected_labels' is unused" in line) or @@ -82,6 +83,7 @@ def filter_clang_tidy_lines( lines ): ("NEGEMMMatrixMultiplyKernel.cpp" in line and "do not use C-style cast to convert between unrelated types" in line) or ("NEPoolingLayerKernel.cpp" in line and "do not use C-style cast to convert between unrelated types" in line) or ("NESoftmaxLayerKernel.cpp" in line and "do not use C-style cast to convert between unrelated types" in line) or + ("GraphUtils.cpp" in line and "consider replacing 'unsigned long' with 'uint32'" in line) or ("GraphUtils.cpp" in line and "consider replacing 'unsigned long' with 'uint64'" in line) or ("parameter 'memory_manager' is unused" in line) or ("parameter 'memory_manager' is copied for each invocation but only used as a const reference" in line) or @@ -110,6 +112,12 @@ def filter_clang_tidy_lines( lines ): out.append(line) print_context=True + elif (("CLMinMaxLocationKernel.cpp" in line and "'?' condition is false" in line) or + ("CLMinMaxLocationKernel.cpp" in line and "Assuming the condition is false" in line) or + ("CLMinMaxLocationKernel.cpp" in line and "Assuming pointer value is null" in line) or + ("CLMinMaxLocationKernel.cpp" in line and "Forming reference to null pointer" in line)): + print_context=False + continue elif print_context: out.append(line) diff --git a/src/core/CL/CLHelpers.cpp b/src/core/CL/CLHelpers.cpp index 5c4d8e9184..821fb4c051 100644 --- a/src/core/CL/CLHelpers.cpp +++ b/src/core/CL/CLHelpers.cpp @@ -161,6 +161,7 @@ GPUTarget get_target_from_device(cl::Device &device) // Query device name size cl_int err = clGetDeviceInfo(device.get(), CL_DEVICE_NAME, 0, nullptr, &name_size); ARM_COMPUTE_ERROR_ON_MSG((err != 0) || (name_size == 0), "clGetDeviceInfo failed to return valid information"); + ARM_COMPUTE_UNUSED(err); std::vector name_buffer(name_size); @@ -206,6 +207,7 @@ bool non_uniform_workgroup_support(const cl::Device &device) size_t extension_size = 0; cl_int err = clGetDeviceInfo(device.get(), CL_DEVICE_EXTENSIONS, 0, nullptr, &extension_size); ARM_COMPUTE_ERROR_ON_MSG((err != 0) || (extension_size == 0), "clGetDeviceInfo failed to return valid information"); + ARM_COMPUTE_UNUSED(err); // Resize vector extension.resize(extension_size); // Query extension @@ -224,6 +226,8 @@ CLVersion get_cl_version(const cl::Device &device) size_t version_size = 0; cl_int err = clGetDeviceInfo(device.get(), CL_DEVICE_VERSION, 0, nullptr, &version_size); ARM_COMPUTE_ERROR_ON_MSG((err != 0) || (version_size == 0), "clGetDeviceInfo failed to return valid information"); + ARM_COMPUTE_UNUSED(err); + // Resize vector version.resize(version_size); // Query version diff --git a/src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp b/src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp index d015ec3e41..69090825fa 100644 --- a/src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp +++ b/src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp @@ -187,6 +187,12 @@ void vector_matrix_multiply_f16(const ITensor *input0, const ITensor *input1, IT }, ina, inb, out); #else /* ARM_COMPUTE_ENABLE_FP16 */ + ARM_COMPUTE_UNUSED(input0); + ARM_COMPUTE_UNUSED(input1); + ARM_COMPUTE_UNUSED(output); + ARM_COMPUTE_UNUSED(window); + ARM_COMPUTE_UNUSED(info); + ARM_COMPUTE_UNUSED(alpha); ARM_COMPUTE_ERROR("Not implemented"); #endif /* ARM_COMPUTE_ENABLE_FP16 */ } @@ -1046,6 +1052,11 @@ void matrix_matrix_multiply_f16(const ITensor *input0, const ITensor *input1, IT }, ina, inb, out); #else /* ARM_COMPUTE_ENABLE_FP16 */ + ARM_COMPUTE_UNUSED(input0); + ARM_COMPUTE_UNUSED(input1); + ARM_COMPUTE_UNUSED(output); + ARM_COMPUTE_UNUSED(window); + ARM_COMPUTE_UNUSED(alpha); ARM_COMPUTE_ERROR("Not implemented"); #endif /* ARM_COMPUTE_ENABLE_FP16 */ } diff --git a/src/core/NEON/kernels/NELocallyConnectedMatrixMultiplyKernel.cpp b/src/core/NEON/kernels/NELocallyConnectedMatrixMultiplyKernel.cpp index a02ebf61ee..1b2942cd93 100644 --- a/src/core/NEON/kernels/NELocallyConnectedMatrixMultiplyKernel.cpp +++ b/src/core/NEON/kernels/NELocallyConnectedMatrixMultiplyKernel.cpp @@ -165,6 +165,7 @@ void vector_matrix_multiply_f16(const ITensor *input0, const ITensor *input1, IT ARM_COMPUTE_UNUSED(input1); ARM_COMPUTE_UNUSED(output); ARM_COMPUTE_UNUSED(window); + ARM_COMPUTE_UNUSED(info); ARM_COMPUTE_ERROR("Not supported, recompile with -march=armv8.2-a+fp16+simd."); #endif /* ARM_COMPUTE_ENABLE_FP16 */ } diff --git a/src/core/NEON/kernels/NENormalizationLayerKernel.cpp b/src/core/NEON/kernels/NENormalizationLayerKernel.cpp index b444c9d4df..fc3f5f2fab 100644 --- a/src/core/NEON/kernels/NENormalizationLayerKernel.cpp +++ b/src/core/NEON/kernels/NENormalizationLayerKernel.cpp @@ -70,6 +70,7 @@ void NENormalizationLayerKernel::configure(const ITensor *input, const ITensor * _border_size = BorderSize(0, border_width); unsigned int num_elems_processed_per_iteration = 16 / input->info()->element_size(); + ARM_COMPUTE_UNUSED(num_elems_processed_per_iteration); switch(_input->info()->data_type()) { diff --git a/src/core/NEON/kernels/NEPixelWiseMultiplicationKernel.cpp b/src/core/NEON/kernels/NEPixelWiseMultiplicationKernel.cpp index 40dcc710de..19d45e2cb5 100644 --- a/src/core/NEON/kernels/NEPixelWiseMultiplicationKernel.cpp +++ b/src/core/NEON/kernels/NEPixelWiseMultiplicationKernel.cpp @@ -335,9 +335,6 @@ void mul_F32_F32_F32_n(const void *__restrict input1_ptr, const void *__restrict template void mul_F16_F16_F16_n(const void *__restrict input1_ptr, const void *__restrict input2_ptr, void *__restrict output_ptr, float scale) { - ARM_COMPUTE_UNUSED(input1_ptr); - ARM_COMPUTE_UNUSED(input2_ptr); - ARM_COMPUTE_UNUSED(output_ptr); #ifdef ARM_COMPUTE_ENABLE_FP16 const auto input1 = static_cast(input1_ptr); const auto input2 = static_cast(input2_ptr); @@ -354,6 +351,10 @@ void mul_F16_F16_F16_n(const void *__restrict input1_ptr, const void *__restrict }; vst2q_f16(output, result); #else /* ARM_COMPUTE_ENABLE_FP16 */ + ARM_COMPUTE_UNUSED(input1_ptr); + ARM_COMPUTE_UNUSED(input2_ptr); + ARM_COMPUTE_UNUSED(output_ptr); + ARM_COMPUTE_UNUSED(scale); ARM_COMPUTE_ERROR("Not supported. Recompile the library with arch=arm64-v8.2-a."); #endif /* ARM_COMPUTE_ENABLE_FP16 */ } -- cgit v1.2.1