From f53e12ef58aa8b1dcc6f7726953abb292659a020 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Prasanna=20R/SNAP=20/SRI-Bangalore/Engineer/=EC=82=BC?= =?utf8?q?=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 18 Dec 2018 15:44:08 +0530 Subject: [PATCH] Redefine LogicalOperation as BinaryLogicalOperation in TypesEx and remove NOT (#4089) This patch renames LogicalOperations as BinaryLogicalOperations in TypesEx.h Removes NOT from enum. Reason: This enum was introduced with an aim of providing unified kernels for LogicalOps But unified kernel is provided only for BinaryLogicalOps and hence LogicalNot enum value is never used. Hence it would be better to rename and remove NOT flag from it, Signed-off-by: prasannar --- .../arm_compute/core/CL/kernels/CLBinaryLogicalOpKernel.h | 2 +- libs/ARMComputeEx/arm_compute/core/TypesEx.h | 5 ++--- .../arm_compute/runtime/CL/functions/CLBinaryLogicalOp.h | 3 ++- libs/ARMComputeEx/src/core/CL/kernels/CLBinaryLogicalOpKernel.cpp | 6 +++--- libs/ARMComputeEx/src/runtime/CL/functions/CLBinaryLogicalOp.cpp | 2 +- runtimes/pure_arm_compute/src/compilation.cc | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBinaryLogicalOpKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBinaryLogicalOpKernel.h index f3869a8..ab33d9d 100644 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBinaryLogicalOpKernel.h +++ b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBinaryLogicalOpKernel.h @@ -45,7 +45,7 @@ public: * @param[out] output Output tensor. */ void configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, - LogicalOperation op); + BinaryLogicalOperation op); // Inherited methods overridden: void run(const Window &window, cl::CommandQueue &queue) override; diff --git a/libs/ARMComputeEx/arm_compute/core/TypesEx.h b/libs/ARMComputeEx/arm_compute/core/TypesEx.h index f4d44d2..8381f1c 100644 --- a/libs/ARMComputeEx/arm_compute/core/TypesEx.h +++ b/libs/ARMComputeEx/arm_compute/core/TypesEx.h @@ -42,12 +42,11 @@ enum class ReduceOperation MIN, /**< Min */ }; -/** Available logical operations */ -enum class LogicalOperation +/** Available binary logical operations */ +enum class BinaryLogicalOperation { AND, /**< AND */ OR, /**< OR */ - NOT, /**< NOT */ }; enum class ComparisonOperation diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBinaryLogicalOp.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBinaryLogicalOp.h index c9a89dd..061e34f 100644 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBinaryLogicalOp.h +++ b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBinaryLogicalOp.h @@ -33,7 +33,8 @@ public: * @param[in] input2 Source tensor2. Data types supported: U8 QASYMM8. * @param[out] output Output tensor. Data types supported: U8, QASYMM8. */ - void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, LogicalOperation op); + void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, + BinaryLogicalOperation op); }; } // namespace arm_compute diff --git a/libs/ARMComputeEx/src/core/CL/kernels/CLBinaryLogicalOpKernel.cpp b/libs/ARMComputeEx/src/core/CL/kernels/CLBinaryLogicalOpKernel.cpp index f3b5830..4e0fe98 100644 --- a/libs/ARMComputeEx/src/core/CL/kernels/CLBinaryLogicalOpKernel.cpp +++ b/libs/ARMComputeEx/src/core/CL/kernels/CLBinaryLogicalOpKernel.cpp @@ -56,7 +56,7 @@ CLBinaryLogicalOpKernel::CLBinaryLogicalOpKernel() } void CLBinaryLogicalOpKernel::configure(const ICLTensor *input1, const ICLTensor *input2, - ICLTensor *output, LogicalOperation op) + ICLTensor *output, BinaryLogicalOperation op) { ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input1, input2); ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(input1, output); @@ -74,10 +74,10 @@ void CLBinaryLogicalOpKernel::configure(const ICLTensor *input1, const ICLTensor int op_code; switch (op) { - case LogicalOperation::AND: + case BinaryLogicalOperation::AND: op_code = 0; break; - case LogicalOperation::OR: + case BinaryLogicalOperation::OR: op_code = 1; break; } diff --git a/libs/ARMComputeEx/src/runtime/CL/functions/CLBinaryLogicalOp.cpp b/libs/ARMComputeEx/src/runtime/CL/functions/CLBinaryLogicalOp.cpp index 77c9f95..7c5fe5e 100644 --- a/libs/ARMComputeEx/src/runtime/CL/functions/CLBinaryLogicalOp.cpp +++ b/libs/ARMComputeEx/src/runtime/CL/functions/CLBinaryLogicalOp.cpp @@ -22,7 +22,7 @@ using namespace arm_compute; void CLBinaryLogicalOp::configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, - LogicalOperation op) + BinaryLogicalOperation op) { auto k = arm_compute::support::cpp14::make_unique(); k->configure(input1, input2, output, op); diff --git a/runtimes/pure_arm_compute/src/compilation.cc b/runtimes/pure_arm_compute/src/compilation.cc index e452990..430f91b 100644 --- a/runtimes/pure_arm_compute/src/compilation.cc +++ b/runtimes/pure_arm_compute/src/compilation.cc @@ -5722,7 +5722,7 @@ void Planner::visit(const ::internal::tflite::op::LogicalAnd::Node &node) auto fn = nnfw::cpp14::make_unique<::arm_compute::CLBinaryLogicalOp>(); fn->configure(CAST_CL(input1_alloc), CAST_CL(input2_alloc), CAST_CL(output_alloc), - ::arm_compute::LogicalOperation::AND); + ::arm_compute::BinaryLogicalOperation::AND); builder.append("LogicalAnd", std::move(fn)); } @@ -5797,7 +5797,7 @@ void Planner::visit(const ::internal::tflite::op::LogicalOr::Node &node) auto fn = nnfw::cpp14::make_unique<::arm_compute::CLBinaryLogicalOp>(); fn->configure(CAST_CL(input1_alloc), CAST_CL(input2_alloc), CAST_CL(output_alloc), - ::arm_compute::LogicalOperation::OR); + ::arm_compute::BinaryLogicalOperation::OR); builder.append("LogicalOr", std::move(fn)); } -- 2.7.4