d-smirnov commented on a change in pull request #6532:
URL: https://github.com/apache/incubator-tvm/pull/6532#discussion_r496105447
##########
File path: src/runtime/contrib/arm_compute_lib/acl_runtime.cc
##########
@@ -416,15 +422,54 @@ class ACLRuntime : public JSONRuntimeBase {
auto function = std::make_shared<arm_compute::NEElementwiseMax>();
function->configure(&layer->inputs[0], &layer->inputs[1],
&layer->outputs[0]);
layer->function = function;
- }
- /*! \brief Allow ACL functions to request auxiliary memory from TVM. */
- ACLAllocator allocator_;
- /*!
- * \brief The network layers represented by acl functions.
- * \note Currently only supports a single layer.
- */
- CachedLayer layer_;
+ /*!
+ * \brief Creates an add/qnn.add layer
+ *
+ * \param layer The ACL layer to build. Containing inputs, outputs and the
ACL function.
+ * \param node The JSON representation of the operator.
+ */
+ void CreateAddLayer(CachedLayer * layer, const JSONGraphNode& node) {
+ auto op_name = node.GetOpName();
+ if ("add" == op_name) {
+
layer->inputs.push_back(MakeACLTensorFromJSONEntry(node.GetInputs()[0]));
+
layer->inputs.push_back(MakeACLTensorFromJSONEntry(node.GetInputs()[1]));
+ layer->outputs.push_back(MakeACLTensorFromJSONNode(node));
+ } else if ("qnn.add" == op_name) {
+ layer->inputs.push_back(MakeACLTensorFromJSONEntry(
+ node.GetInputs()[0], &node.GetInputs()[2], &node.GetInputs()[3]));
+ layer->inputs.push_back(MakeACLTensorFromJSONEntry(
+ node.GetInputs()[1], &node.GetInputs()[4], &node.GetInputs()[5]));
+ layer->outputs.push_back(
+ MakeACLTensorFromJSONNode(node, &node.GetInputs()[6],
&node.GetInputs()[7]));
+ } else {
+ LOG(FATAL) << "Unsupported op: " << op_name;
Review comment:
replaced with throw
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]