aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiCongLi <sicong.li@arm.com>2020-12-11 15:07:53 +0000
committerSiCong Li <sicong.li@arm.com>2020-12-23 10:46:06 +0000
commit410e21e88db9d98c8144cd93047e506ecd0b7ab4 (patch)
tree29ad49910db2fe11ee77c31224a61ccb7436a0a5
parent2dcffdeda88b59aecc9a4ad6d5fb8b44f9d638b7 (diff)
downloadComputeLibrary-410e21e88db9d98c8144cd93047e506ecd0b7ab4.tar.gz
Fix baremetal arm_compute_validation build errors
* 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>
-rw-r--r--SConstruct4
-rw-r--r--src/core/CL/kernels/CLFFTRadixStageKernel.cpp1
-rw-r--r--src/core/NEON/NEMath.inl6
-rw-r--r--src/core/NEON/kernels/NEFFTRadixStageKernel.cpp1
-rw-r--r--src/core/NEON/kernels/arm_gemm/gemm_qint8.cpp4
-rw-r--r--src/core/NEON/kernels/arm_gemm/gemm_quint8.cpp6
-rw-r--r--support/ToolchainSupport.h4
-rw-r--r--tests/validation/reference/DFT.cpp1
8 files changed, 18 insertions, 9 deletions
diff --git a/SConstruct b/SConstruct
index b543bc0ebb..6b20ac2177 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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)])
diff --git a/src/core/CL/kernels/CLFFTRadixStageKernel.cpp b/src/core/CL/kernels/CLFFTRadixStageKernel.cpp
index 5df8ca6025..5db3cb6bf2 100644
--- a/src/core/CL/kernels/CLFFTRadixStageKernel.cpp
+++ b/src/core/CL/kernels/CLFFTRadixStageKernel.cpp
@@ -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>
diff --git a/src/core/NEON/NEMath.inl b/src/core/NEON/NEMath.inl
index a1c3d41880..1f5cb56dfc 100644
--- a/src/core/NEON/NEMath.inl
+++ b/src/core/NEON/NEMath.inl
@@ -21,13 +21,11 @@
* 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 */
diff --git a/src/core/NEON/kernels/NEFFTRadixStageKernel.cpp b/src/core/NEON/kernels/NEFFTRadixStageKernel.cpp
index cb1391ab4e..971d4fdefe 100644
--- a/src/core/NEON/kernels/NEFFTRadixStageKernel.cpp
+++ b/src/core/NEON/kernels/NEFFTRadixStageKernel.cpp
@@ -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>
diff --git a/src/core/NEON/kernels/arm_gemm/gemm_qint8.cpp b/src/core/NEON/kernels/arm_gemm/gemm_qint8.cpp
index 0ffe8080f4..8d9fee6da4 100644
--- a/src/core/NEON/kernels/arm_gemm/gemm_qint8.cpp
+++ b/src/core/NEON/kernels/arm_gemm/gemm_qint8.cpp
@@ -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); }
},
diff --git a/src/core/NEON/kernels/arm_gemm/gemm_quint8.cpp b/src/core/NEON/kernels/arm_gemm/gemm_quint8.cpp
index 84628c0c48..eead592d1f 100644
--- a/src/core/NEON/kernels/arm_gemm/gemm_quint8.cpp
+++ b/src/core/NEON/kernels/arm_gemm/gemm_quint8.cpp
@@ -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,
diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h
index 8bf7f988c2..e79084a629 100644
--- a/support/ToolchainSupport.h
+++ b/support/ToolchainSupport.h
@@ -40,6 +40,10 @@
#include "support/Bfloat16.h"
#include "support/Half.h"
+#ifndef M_PI
+#define M_PI (3.14159265358979323846)
+#endif // M_PI
+
namespace arm_compute
{
namespace support
diff --git a/tests/validation/reference/DFT.cpp b/tests/validation/reference/DFT.cpp
index b98bc77b1d..d5f7010a5b 100644
--- a/tests/validation/reference/DFT.cpp
+++ b/tests/validation/reference/DFT.cpp
@@ -27,6 +27,7 @@
#include "Permute.h"
#include "Reverse.h"
#include "SliceOperations.h"
+#include "support/ToolchainSupport.h"
#include <cmath>