aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTracy Narine <tracy.narine@arm.com>2024-01-23 09:40:00 +0000
committerTracy Narine <tracy.narine@arm.com>2024-01-23 13:10:34 +0000
commit91ffe3d84528a68a68de8f8a1a36a1a2177233a5 (patch)
tree1b1d04dca3fd61efb60ca0fc29dd6656ed5a16a4
parentbd738081b8fcea4599a06f01d5c07979f3b0fcb3 (diff)
downloadarmnn-91ffe3d84528a68a68de8f8a1a36a1a2177233a5.tar.gz
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 <tracy.narine@arm.com> Change-Id: Ie4ee80666c6f8033bb72e0e6cb8ca5ef41933990
-rw-r--r--src/backends/tosaCommon/operatorMappings/ActivationOperator.cpp2
-rw-r--r--src/backends/tosaCommon/operatorMappings/TosaOperatorUtils.hpp12
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 <tosa_serialization_handler.h>
-#include <version.h>
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)