[PureACL] Enable NEON to run Mobilenet (#2600)
author윤현식/동작제어Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Wed, 5 Sep 2018 08:36:15 +0000 (17:36 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 5 Sep 2018 08:36:15 +0000 (17:36 +0900)
This commit enables NEON to run Mobilenet by providing `depthwise_conv` and `reshape` for NEON.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
runtimes/pure_arm_compute/src/compilation.cc

index 1fdc23d..9145348 100644 (file)
@@ -34,6 +34,7 @@
 #include <arm_compute/runtime/NEON/functions/NEPoolingLayer.h>
 #include <arm_compute/runtime/NEON/functions/NEActivationLayer.h>
 #include <arm_compute/runtime/NEON/functions/NEConvolutionLayer.h>
+#include <arm_compute/runtime/NEON/functions/NEDepthwiseConvolutionLayer.h>
 
 #include "internal/arm_compute.h"
 #include "internal/arm_compute/Cast.h"
@@ -1265,7 +1266,13 @@ void Planner::visit(const ::internal::tflite::op::DepthwiseConv2D::Implicit::Nod
       builder.append("DepthwiseConv2D", std::move(fn));
     }
     else
-      throw std::runtime_error("Not supported, yet");
+    {
+      auto fn = nnfw::make_unique<::arm_compute::NEDepthwiseConvolutionLayer>();
+
+      fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info, param.multipler);
+
+      builder.append("DepthwiseConv2D", std::move(fn));
+    }
 
     ActivationBuilder{builder}.append(param.activation, ofm_alloc);
   };
@@ -2192,7 +2199,13 @@ void Planner::visit(const ::internal::tflite::op::Reshape::Node &node)
       builder.append("Reshape", std::move(fn));
     }
     else
-      throw std::runtime_error("Not supported, yet");
+    {
+      auto fn = nnfw::make_unique<GenericReshapeLayer>();
+
+      fn->configure(input_alloc, output_alloc);
+
+      builder.append("Reshape", std::move(fn));
+    }
   };
 
   _builder.addStage(stage);