From 91ffe3d84528a68a68de8f8a1a36a1a2177233a5 Mon Sep 17 00:00:00 2001 From: Tracy Narine Date: Tue, 23 Jan 2024 09:40:00 +0000 Subject: Minor fixes related to the LeakyRelu Activation support commit (IVGCVSW-7344) * Using the tosa defines from the serialization library to avoid compile errors in other backends * Fixing a bug in the version compat macro Signed-off-by: Tracy Narine Change-Id: Ie4ee80666c6f8033bb72e0e6cb8ca5ef41933990 --- .../tosaCommon/operatorMappings/ActivationOperator.cpp | 2 +- .../tosaCommon/operatorMappings/TosaOperatorUtils.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp b/src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp index 4009ae834a..c3e424ea83 100644 --- a/src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp +++ b/src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp @@ -65,7 +65,7 @@ TosaSerializationBasicBlock* ConvertActivationToTosaOperator(const Layer* layer, DType outputDType0 = ArmNNToDType(outputs[0]->GetDataType()); tensors.push_back(new TosaSerializationTensor(outputName, outputShape0, outputDType0, {})); -#if TOSA_FWD_COMPAT_VERSION(0, 60, 0) +#if TOSA_COMPAT_VERSION(0, 60, 0) std::string outputNameMAXMIN= std::string("intermediate3_") + GetUniqueTosaMappingID(); if (inputDType0 == DType::DType_FP32) diff --git a/src/backends/tosaCommon/operatorMappings/TosaOperatorUtils.hpp b/src/backends/tosaCommon/operatorMappings/TosaOperatorUtils.hpp index 05ccef4a9c..817aba36b2 100644 --- a/src/backends/tosaCommon/operatorMappings/TosaOperatorUtils.hpp +++ b/src/backends/tosaCommon/operatorMappings/TosaOperatorUtils.hpp @@ -12,7 +12,6 @@ #include "common/include/ProfilingGuid.hpp" #include -#include using namespace armnn; using namespace tosa; @@ -454,8 +453,9 @@ inline void CreateConstTosaOperator(const std::string& outputName, ARMNN_THROW_MSG_IF_FALSE(tensor, armnn::Exception, "CreateConstTosaOperator: failed to created tensor"); } -// Macro to conditionally compile Tosa code -#define TOSA_FWD_COMPAT_VERSION(_major, _minor, _patch) \ - (TOSA_REFERENCE_MODEL_VERSION_MAJOR >= _major) && \ - (TOSA_REFERENCE_MODEL_VERSION_MINOR >= _minor) && \ - (TOSA_REFERENCE_MODEL_VERSION_PATCH >= _patch) +// Macro to preserve usage of a code block as the TOSA library version advances. Parameters +// specify the minimum version required by the code block. +#define TOSA_COMPAT_VERSION(_major, _minor, _patch) \ + (TOSA_VERSION_MAJOR >= _major) || \ + (TOSA_VERSION_MINOR >= _minor) || \ + (TOSA_VERSION_PATCH >= _patch) -- cgit v1.2.1