[Interp] DepthwiseConv and Reshape kernel skeleton (#5415)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 14 Jun 2019 07:29:16 +0000 (16:29 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 14 Jun 2019 07:29:16 +0000 (16:29 +0900)
- DepthwiseConv kernel skeleton for mobilenet
- Reshape kernel skeleton for inception v3 2018

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/core/src/exec/interp/Interpreter.cc
runtimes/neurun/core/src/exec/interp/Registration.h
runtimes/neurun/core/src/exec/interp/operations/DepthwiseConv.cc [new file with mode: 0644]
runtimes/neurun/core/src/exec/interp/operations/Reshape.cc [new file with mode: 0644]

index 6576f83..81de27c 100644 (file)
@@ -56,6 +56,8 @@ public:
     _kernels[NodeName::AvgPool2DNode] = getAvgPool2DNode();
     _kernels[NodeName::FullyConnectedNode] = getFullyConnectedNode();
     _kernels[NodeName::SoftmaxNode] = getSoftMaxNode();
+    _kernels[NodeName::ReshapeNode] = getReshapeNode();
+    _kernels[NodeName::DepthwiseConv2DNode] = getDepthwiseConvNode();
   }
 
   void execute(const model::OperationIndex &idx)
index 66d0fe8..37c591f 100644 (file)
@@ -42,6 +42,8 @@ OpKernel *getConcatNode();
 OpKernel *getAvgPool2DNode();
 OpKernel *getFullyConnectedNode();
 OpKernel *getSoftMaxNode();
+OpKernel *getDepthwiseConvNode();
+OpKernel *getReshapeNode();
 
 } // namespace interp
 } // namespace exec
diff --git a/runtimes/neurun/core/src/exec/interp/operations/DepthwiseConv.cc b/runtimes/neurun/core/src/exec/interp/operations/DepthwiseConv.cc
new file mode 100644 (file)
index 0000000..cf45b3f
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "exec/interp/Registration.h"
+
+namespace neurun
+{
+namespace exec
+{
+namespace interp
+{
+
+OpKernel *getDepthwiseConvNode()
+{
+  static OpKernel kernel = {nullptr, nullptr};
+  return &kernel;
+}
+
+} // namespace interp
+} // namespace exec
+} // namespace neurun
diff --git a/runtimes/neurun/core/src/exec/interp/operations/Reshape.cc b/runtimes/neurun/core/src/exec/interp/operations/Reshape.cc
new file mode 100644 (file)
index 0000000..7b5f278
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "exec/interp/Registration.h"
+
+namespace neurun
+{
+namespace exec
+{
+namespace interp
+{
+
+OpKernel *getReshapeNode()
+{
+  static OpKernel kernel = {nullptr, nullptr};
+  return &kernel;
+}
+
+} // namespace interp
+} // namespace exec
+} // namespace neurun