Fix baremetal arm_compute_validation build errors
authorSiCongLi <sicong.li@arm.com>
Fri, 11 Dec 2020 15:07:53 +0000 (15:07 +0000)
committerSiCong Li <sicong.li@arm.com>
Wed, 23 Dec 2020 10:46:06 +0000 (10:46 +0000)
* Add -C flag to instruct preprocessor not to strip comments. This is to
prevent marker comments like '// fall through' that suppresses certain
warnings from being removed.

* Fix unused variable warnings.

* Add M_PI definition that's missing from certain toolchain standard
libraries.

Resolves COMPMID-4054

Change-Id: I1d641db668685d4b678f3d0efed84bfe9e630b4b
Signed-off-by: SiCongLi <sicong.li@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4692
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
SConstruct
src/core/CL/kernels/CLFFTRadixStageKernel.cpp
src/core/NEON/NEMath.inl
src/core/NEON/kernels/NEFFTRadixStageKernel.cpp
src/core/NEON/kernels/arm_gemm/gemm_qint8.cpp
src/core/NEON/kernels/arm_gemm/gemm_quint8.cpp
support/ToolchainSupport.h
tests/validation/reference/DFT.cpp

index b543bc0ebb1bbb692b9fb9252952e8588414c49c..6b20ac21776749d9cae500635a2f755f7f8c3506 100644 (file)
@@ -166,6 +166,10 @@ elif 'armclang' in cpp_compiler:
 else:
     env.Append(CXXFLAGS = ['-Wlogical-op','-Wnoexcept','-Wstrict-null-sentinel'])
 
+if cpp_compiler == 'g++':
+    # Don't strip comments that could include markers
+    env.Append(CXXFLAGS = ['-C'])
+
 if env['cppthreads']:
     env.Append(CPPDEFINES = [('ARM_COMPUTE_CPP_SCHEDULER', 1)])
 
index 5df8ca6025ad0c89a5fd19d98ad51f34b981dc57..5db3cb6bf2fe3e643dba5f799abfa00e2e2bdbe7 100644 (file)
@@ -32,6 +32,7 @@
 #include "src/core/helpers/AutoConfiguration.h"
 #include "src/core/helpers/WindowHelpers.h"
 #include "support/StringSupport.h"
+#include "support/ToolchainSupport.h"
 
 #include <cmath>
 
index a1c3d4188096fc06319ba457c519b87b93d78bd2..1f5cb56dfc04327be1e6762997c9b1d0f60aa6c6 100644 (file)
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  */
+#include "support/ToolchainSupport.h"
+
 #include <cmath>
 #include <limits>
 
-#ifndef M_PI
-#define M_PI (3.14159265358979323846)
-#endif // M_PI
-
 namespace arm_compute
 {
 /** Exponent polynomial coefficients */
index cb1391ab4e31c5e2371f7007335ad1ea84d6e4ae..971d4fdefe034d6dd5058bea598f0f1a3e766d2a 100644 (file)
@@ -32,6 +32,7 @@
 #include "src/core/NEON/wrapper/wrapper.h"
 #include "src/core/helpers/AutoConfiguration.h"
 #include "src/core/helpers/WindowHelpers.h"
+#include "support/ToolchainSupport.h"
 
 #include <arm_neon.h>
 #include <cmath>
index 0ffe8080f4911fa64bbda860ec2aee6627ad6b93..8d9fee6da4b3601b9a5f3ae1a82d0d735f7ec810 100644 (file)
@@ -74,14 +74,14 @@ static const GemmImplementation<int8_t, int8_t, Requantize32> gemm_qint8_methods
 {
     GemmMethod::GEMM_HYBRID,
     "sve_hybrid_s8qs_dot_6x4VL",
-    [](const GemmArgs &args, const Requantize32 &qp) { return quant_hybrid_symmetric(qp); },
+    [](const GemmArgs &, const Requantize32 &qp) { return quant_hybrid_symmetric(qp); },
     nullptr,
     [](const GemmArgs &args, const Requantize32 &qp) { return new GemmHybridIndirect<cls_sve_hybrid_s8qs_dot_6x4VL, int8_t, int8_t, Requantize32>(args, qp); }
 },
 {
     GemmMethod::GEMM_HYBRID,
     "sve_hybrid_s8qa_dot_4x4VL",
-    [](const GemmArgs &args, const Requantize32 &qp) { return quant_hybrid_asymmetric(qp); },
+    [](const GemmArgs &, const Requantize32 &qp) { return quant_hybrid_asymmetric(qp); },
     nullptr,
     [](const GemmArgs &args, const Requantize32 &qp) { return new GemmHybridIndirect<cls_sve_hybrid_s8qa_dot_4x4VL, int8_t, int8_t, Requantize32>(args, qp); }
 },
index 84628c0c48473f198ee2b5aa3149dcc67a2660be..eead592d1f136fafaa3a808bc81799cbc80143d8 100644 (file)
@@ -69,15 +69,15 @@ static const GemmImplementation<uint8_t, uint8_t, Requantize32> gemm_quint8_meth
 },
 #ifdef SVE2 // Requantizing kernels include some SVE2 only instructions (SQRDMULH, SRSHL)
 {
-    GemmMethod::GEMM_HYBRID, 
+    GemmMethod::GEMM_HYBRID,
     "sve_hybrid_u8qa_dot_4x4VL",
-    [](const GemmArgs &args, const Requantize32 &qp) { return quant_hybrid_asymmetric(qp); },
+    [](const GemmArgs &, const Requantize32 &qp) { return quant_hybrid_asymmetric(qp); },
     nullptr,
     [](const GemmArgs &args, const Requantize32 &qp) { return new GemmHybridIndirect<cls_sve_hybrid_u8qa_dot_4x4VL, uint8_t, uint8_t, Requantize32>(args, qp); }
 },
 #endif
 {
-    GemmMethod::GEMM_HYBRID, 
+    GemmMethod::GEMM_HYBRID,
     "sve_hybrid_u8u32_dot_6x4VL",
     nullptr,
     nullptr,
index 8bf7f988c2c44b70464d6e62ef278175a71053b1..e79084a6291f26d9569fe98c0283358b68d4b7e6 100644 (file)
 #include "support/Bfloat16.h"
 #include "support/Half.h"
 
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif // M_PI
+
 namespace arm_compute
 {
 namespace support
index b98bc77b1dbaeeec8ea5f53beef213473b23d8f8..d5f7010a5baefb222d03f7d47eda83f6a0df4a96 100644 (file)
@@ -27,6 +27,7 @@
 #include "Permute.h"
 #include "Reverse.h"
 #include "SliceOperations.h"
+#include "support/ToolchainSupport.h"
 
 #include <cmath>