Redefine LogicalOperation as BinaryLogicalOperation in TypesEx and remove NOT (#4089)
authorPrasanna R/SNAP /SRI-Bangalore/Engineer/삼성전자 <prasanna.r@samsung.com>
Tue, 18 Dec 2018 10:14:08 +0000 (15:44 +0530)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 18 Dec 2018 10:14:08 +0000 (19:14 +0900)
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 <prasanna.r@samsung.com>
libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBinaryLogicalOpKernel.h
libs/ARMComputeEx/arm_compute/core/TypesEx.h
libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBinaryLogicalOp.h
libs/ARMComputeEx/src/core/CL/kernels/CLBinaryLogicalOpKernel.cpp
libs/ARMComputeEx/src/runtime/CL/functions/CLBinaryLogicalOp.cpp
runtimes/pure_arm_compute/src/compilation.cc

index f3869a8..ab33d9d 100644 (file)
@@ -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;
index f4d44d2..8381f1c 100644 (file)
@@ -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
index c9a89dd..061e34f 100644 (file)
@@ -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
index f3b5830..4e0fe98 100644 (file)
@@ -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;
   }
index 77c9f95..7c5fe5e 100644 (file)
@@ -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<CLBinaryLogicalOpKernel>();
   k->configure(input1, input2, output, op);
index e452990..430f91b 100644 (file)
@@ -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));
     }