Support SUB_EX, DIV_EX in pure ACL (#1567)
author이상규/동작제어Lab(SR)/Principal Engineer/삼성전자 <sg5.lee@samsung.com>
Tue, 5 Jun 2018 06:11:24 +0000 (15:11 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 5 Jun 2018 06:11:24 +0000 (15:11 +0900)
SUB_EX and DIV_EX are supported in pure ACL.
We decided to put our extensions in extension,
even it is a part of NN API 1.1 and we already brought code.

Related issue: #1485

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
runtimes/pure_arm_compute/src/model.cc

index 9453c54..4cf6d3f 100644 (file)
@@ -316,6 +316,36 @@ int ANeuralNetworksModel_addOperationEx(ANeuralNetworksModel *model,
 
       break;
     }
+    case ANEURALNETWORKS_SUB_EX:
+    {
+      assert(inputCount == 3);
+      assert(outputCount == 1);
+
+      using internal::tflite::op::Sub::Param;
+      using internal::tflite::op::Sub::Node;
+
+      // Add 'operations'
+      auto &operations = model->deref().operations();
+
+      operations.emplace_back<Node>(Param{inputCount, inputs, outputCount, outputs});
+
+      break;
+    }
+    case ANEURALNETWORKS_DIV_EX:
+    {
+      assert(inputCount == 3);
+      assert(outputCount == 1);
+
+      using internal::tflite::op::Div::Param;
+      using internal::tflite::op::Div::Node;
+
+      // Add 'operations'
+      auto &operations = model->deref().operations();
+
+      operations.emplace_back<Node>(Param{inputCount, inputs, outputCount, outputs});
+
+      break;
+    }
     default:
       throw std::runtime_error{"Not supported operation"};
   }