[cop, neurun] Use cpu backend by default for custom op (#7346)
author이상규/On-Device Lab(SR)/Principal Engineer/삼성전자 <sg5.lee@samsung.com>
Tue, 10 Sep 2019 09:54:17 +0000 (18:54 +0900)
committer이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Tue, 10 Sep 2019 09:54:17 +0000 (18:54 +0900)
`neurun` uses `acl_cl` backends by default.
However, for custom op, cpu backend will be used by default.

Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
runtimes/neurun/core/src/compiler/ManualScheduler.cc

index c7de7b2..efd5ccc 100644 (file)
@@ -44,6 +44,9 @@ std::unique_ptr<BackendResolver> ManualScheduler::schedule(const graph::Graph &g
 
   // 2. Backend per operation type
   std::unordered_map<std::type_index, backend::Backend *> op_type_map;
+  // By default, CustomNode uses cpu backend
+  op_type_map[typeid(model::operation::CustomNode)] =
+      backend::BackendManager::instance().get("cpu");
 #define OP(InternalName, IsNnApi)                                                             \
   if (IsNnApi)                                                                                \
   {                                                                                           \