From c5a613982c12977cef2e2e16aaf9c50fa1629a88 Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Wed, 6 Jan 2021 15:13:08 +0000 Subject: Clean up macro definitions in arm_compute headers - Expose loose macros by prefixing "ARM_COMPUTE_" Resolves: COMPMID-3701 Signed-off-by: Giorgio Arena Change-Id: I4334b01c1a5cd8585f4a1ba2d870be956c61a83d Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4769 Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- arm_compute/core/TracePoint.h | 26 +++++++++++++------------- arm_compute/core/WindowIterator.h | 26 +++++++++++++------------- arm_compute/core/utils/math/SafeOps.h | 10 +++++----- 3 files changed, 31 insertions(+), 31 deletions(-) (limited to 'arm_compute') diff --git a/arm_compute/core/TracePoint.h b/arm_compute/core/TracePoint.h index 799d62ec2c..508c86acff 100644 --- a/arm_compute/core/TracePoint.h +++ b/arm_compute/core/TracePoint.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Arm Limited. + * Copyright (c) 2020-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -31,7 +31,7 @@ namespace arm_compute { #ifdef ARM_COMPUTE_TRACING_ENABLED -#define CREATE_TRACEPOINT(...) TracePoint __tp(__VA_ARGS__) +#define ARM_COMPUTE_CREATE_TRACEPOINT(...) TracePoint __tp(__VA_ARGS__) /** Class used to dump configuration values in functions and kernels */ class TracePoint final @@ -77,7 +77,7 @@ TracePoint::Args &&operator<<(typename std::enable_if < !std::is_pointer::val template TracePoint::Args &&operator<<(TracePoint::Args &&tp, const T *arg); -#define CONST_REF_CLASS(type) \ +#define ARM_COMPUTE_CONST_REF_CLASS(type) \ template <> \ TracePoint::Args &&operator<<(TracePoint::Args &&tp, const type &arg) \ { \ @@ -86,7 +86,7 @@ TracePoint::Args &&operator<<(TracePoint::Args &&tp, const T *arg); return std::move(tp); \ } -#define CONST_PTR_ADDRESS(type) \ +#define ARM_COMPUTE_CONST_PTR_ADDRESS(type) \ template <> \ TracePoint::Args &&operator<<(TracePoint::Args &&tp, const type *arg) \ { \ @@ -94,7 +94,7 @@ TracePoint::Args &&operator<<(TracePoint::Args &&tp, const T *arg); tp.args.push_back(#type "*(" + to_ptr_string(arg) + ")"); \ return std::move(tp); \ } -#define CONST_PTR_CLASS(type) \ +#define ARM_COMPUTE_CONST_PTR_CLASS(type) \ template <> \ TracePoint::Args &&operator<<(TracePoint::Args &&tp, const type *arg) \ { \ @@ -106,7 +106,7 @@ TracePoint::Args &&operator<<(TracePoint::Args &&tp, const T *arg); return std::move(tp); \ } -#define CONST_REF_SIMPLE(type) \ +#define ARM_COMPUTE_CONST_REF_SIMPLE(type) \ template <> \ TracePoint::Args &&operator<<(TracePoint::Args &&tp, const type &arg) \ { \ @@ -115,19 +115,19 @@ TracePoint::Args &&operator<<(TracePoint::Args &&tp, const T *arg); return std::move(tp); \ } -#define TRACE_TO_STRING(type) \ +#define ARM_COMPUTE_TRACE_TO_STRING(type) \ std::string to_string(const type &arg) \ { \ ARM_COMPUTE_UNUSED(arg); \ return ""; \ } #else /* ARM_COMPUTE_TRACING_ENABLED */ -#define CREATE_TRACEPOINT(...) -#define CONST_REF_CLASS(type) -#define CONST_PTR_ADDRESS(type) -#define CONST_PTR_CLASS(type) -#define CONST_REF_SIMPLE(type) -#define TRACE_TO_STRING(type) +#define ARM_COMPUTE_CREATE_TRACEPOINT(...) +#define ARM_COMPUTE_CONST_REF_CLASS(type) +#define ARM_COMPUTE_CONST_PTR_ADDRESS(type) +#define ARM_COMPUTE_CONST_PTR_CLASS(type) +#define ARM_COMPUTE_CONST_REF_SIMPLE(type) +#define ARM_COMPUTE_TRACE_TO_STRING(type) #endif /* ARM_COMPUTE_TRACING_ENABLED */ } //namespace arm_compute diff --git a/arm_compute/core/WindowIterator.h b/arm_compute/core/WindowIterator.h index 0967cefe7a..c15a50cf47 100644 --- a/arm_compute/core/WindowIterator.h +++ b/arm_compute/core/WindowIterator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -28,9 +28,9 @@ #include "arm_compute/core/ITensor.h" #include "arm_compute/core/Window.h" -//FIXME: Delete the "PRINTF" before the release. In the meantime it's probably going to be useful to debug -//#define PRINTF printf -#define PRINTF(...) +//FIXME: Delete the "ARM_COMPUTE_PRINTF" before the release. In the meantime it's probably going to be useful to debug +//#define ARM_COMPUTE_PRINTF printf +#define ARM_COMPUTE_PRINTF(...) namespace arm_compute { @@ -170,14 +170,14 @@ public: { while(_end.z() != _position.z()) { - PRINTF("New slice %d\n", _position.z()); + ARM_COMPUTE_PRINTF("New slice %d\n", _position.z()); iterate_2D_internal(on_new_row_size, _w.x().end() - _w.x().step(), _w.y().end() - _w.y().step()); _position[2] += _w.z().step(); _position[1] = _w.y().start(); _position[0] = _w.x().start(); } // Left over: - PRINTF("Left over slice\n"); + ARM_COMPUTE_PRINTF("Left over slice\n"); iterate_2D(on_new_row_size); } @@ -220,7 +220,7 @@ private: if(end_y == _position.y()) { // Single row: - PRINTF("Partial row only\n"); + ARM_COMPUTE_PRINTF("Partial row only\n"); // Both start and end belong to the same row: iterate_over_dim0(end_x + _w.x().step(), on_new_row_size); } @@ -230,7 +230,7 @@ private: if(_w.x().start() != _position.x()) { //Start in the middle of a row: process left-over X - PRINTF("Partial row first\n"); + ARM_COMPUTE_PRINTF("Partial row first\n"); iterate_over_dim0(_w.x().end(), on_new_row_size); _position[1] += _w.y().step(); } @@ -239,7 +239,7 @@ private: bool no_leftover = end_x + _w.x().step() == _w.x().end(); if(no_leftover) { - PRINTF("no left over\n"); + ARM_COMPUTE_PRINTF("no left over\n"); //Switch to full row size: on_new_row_size(_w[0].start(), _w.x().end()); // Shouldn't be possible to reach that point and not have at least one entire row to process @@ -249,17 +249,17 @@ private: } else { - PRINTF("with left over\n"); + ARM_COMPUTE_PRINTF("with left over\n"); // Are there full rows to process ? if(_position[1] != end_y) { - PRINTF("full rows\n"); + ARM_COMPUTE_PRINTF("full rows\n"); //Switch to full row size: on_new_row_size(_w[0].start(), _w.x().end()); iterate_over_dim1(end_y); } - PRINTF("Final leftover\n"); + ARM_COMPUTE_PRINTF("Final leftover\n"); //Leftover end x _position[0] = _w.x().start(); iterate_over_dim0(end_x + _w.x().step(), on_new_row_size); @@ -298,7 +298,7 @@ private: */ void iterate_over_dim0(int end) { - PRINTF("X [%d, %d, %d]\n", _position.x(), end, _w[0].step()); + ARM_COMPUTE_PRINTF("X [%d, %d, %d]\n", _position.x(), end, _w[0].step()); // Both start and end belong to the same row: ARM_COMPUTE_ERROR_ON(_position[0] > end); for(; _position.x() < end; _position[0] += _w[0].step()) diff --git a/arm_compute/core/utils/math/SafeOps.h b/arm_compute/core/utils/math/SafeOps.h index c222c65e84..f0d76a3d02 100644 --- a/arm_compute/core/utils/math/SafeOps.h +++ b/arm_compute/core/utils/math/SafeOps.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -46,7 +46,7 @@ namespace math * * @return The addition result */ -template ::value)> +template ::value)> T safe_integer_add(T val_a, T val_b) { T result = 0; @@ -78,7 +78,7 @@ T safe_integer_add(T val_a, T val_b) * * @return The subtraction result */ -template ::value)> +template ::value)> T safe_integer_sub(T val_a, T val_b) { T result = 0; @@ -110,7 +110,7 @@ T safe_integer_sub(T val_a, T val_b) * * @return The multiplication result */ -template ::value)> +template ::value)> T safe_integer_mul(T val_a, T val_b) { T result = 0; @@ -160,7 +160,7 @@ T safe_integer_mul(T val_a, T val_b) * * @return The quotient */ -template ::value)> +template ::value)> T safe_integer_div(T val_a, T val_b) { T result = 0; -- cgit v1.2.1