[neurun] Remove the things related to "NN API name". (#4748)
author장지섭/On-Device Lab(SR)/Engineer/삼성전자 <jiseob.jang@samsung.com>
Thu, 14 Mar 2019 11:43:53 +0000 (20:43 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Thu, 14 Mar 2019 11:43:52 +0000 (20:43 +0900)
This commit Removes the things related to "NN API name".

Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
runtimes/neurun/src/backend/interface/IStageGenerator.h
runtimes/neurun/src/compiler/BackendResolver.h
runtimes/neurun/src/model/operation/NodeVisitor.h
runtimes/neurun/src/model/operation/Op.lst
runtimes/neurun/src/util/config/Config.lst

index 86e8ded..66fe761 100644 (file)
@@ -42,7 +42,7 @@ public:
   virtual std::shared_ptr<ITensorBuilder> tensor_builder() = 0;
 
 protected:
-#define OP(InternalName, IsNnApi, NnApiName)                          \
+#define OP(InternalName, IsNnApi)                                     \
   virtual void visit(const model::operation::InternalName &) override \
   {                                                                   \
     throw std::runtime_error("NYI");                                  \
index 07c5fc5..da5d24b 100644 (file)
@@ -43,7 +43,7 @@ public:
     if (backend_all_str.compare("none") != 0)
     {
       VERBOSE(BackendResolver) << "Use backend for all ops: " << backend_all_str << std::endl;
-#define OP(InternalName, IsNnApi, NnApiName)                    \
+#define OP(InternalName, IsNnApi)                               \
   if (IsNnApi)                                                  \
   {                                                             \
     auto backend = _backend_manager->get(backend_all_str);      \
@@ -54,14 +54,15 @@ public:
     }
     else
     {
-#define OP(InternalName, IsNnApi, NnApiName)                                                      \
-  if (IsNnApi)                                                                                    \
-  {                                                                                               \
-    const auto &backend_str =                                                                     \
-        config::ConfigManager::instance().get<std::string>(config::OP_BACKEND_##NnApiName);       \
-    auto backend = _backend_manager->get(backend_str);                                            \
-    VERBOSE(BackendResolver) << "backend for " << #NnApiName << ": " << backend_str << std::endl; \
-    _gen_map[typeid(model::operation::InternalName)] = backend;                                   \
+#define OP(InternalName, IsNnApi)                                                              \
+  if (IsNnApi)                                                                                 \
+  {                                                                                            \
+    const auto &backend_str =                                                                  \
+        config::ConfigManager::instance().get<std::string>(config::OP_BACKEND_##InternalName); \
+    auto backend = _backend_manager->get(backend_str);                                         \
+    VERBOSE(BackendResolver) << "backend for " << #InternalName << ": " << backend_str         \
+                             << std::endl;                                                     \
+    _gen_map[typeid(model::operation::InternalName)] = backend;                                \
   }
 
 #include "model/operation/Op.lst"
index a68a4dd..166f2d1 100644 (file)
@@ -31,7 +31,7 @@ struct NodeVisitor
 {
   virtual ~NodeVisitor() = default;
 
-#define OP(InternalName, IsNnApi, NnApiName) \
+#define OP(InternalName, IsNnApi) \
   virtual void visit(const InternalName &) {}
 #include "model/operation/Op.lst"
 #undef OP
index 085138a..89afdde 100644 (file)
 #error  Define OP before including this file
 #endif
 
-// NOTE The relation between "Internal Name" and "NN API Name" is "1 : N".
+// NOTE The relation between "Internal Name" and "NN API" is "1 : N".
 
-// Internal Name           | NN API? | NN API Name
-OP(AddNode                 , true    , ADD)
-OP(SubNode                 , true    , SUB)
-OP(CastNode                , true    , CAST_EX)
-OP(Conv2DNode              , true    , CONV_2D)
-OP(DepthwiseConv2DNode     , true    , DEPTHWISECONV_2D)
-OP(AvgPool2DNode           , true    , AVERAGE_POOL_2D)
-OP(MaxPool2DNode           , true    , MAX_POOL_2D)
-OP(ConcatNode              , true    , CONCATENATION)
-OP(FullyConnectedNode      , true    , FULLY_CONNECTED)
-OP(ReduceSumNode           , true    , REDUCE_SUM_EX)
-OP(ReshapeNode             , true    , RESHAPE)
-OP(MulNode                 , true    , MUL)
-OP(SoftmaxNode             , true    , SOFTMAX)
-OP(SqueezeNode             , true    , SQUEEZE)
-OP(StridedSliceNode        , true    , STRIDED_SLICE)
-OP(TanhNode                , true    , TANH)
-OP(LogisticNode            , true    , LOGISTIC)
-OP(DivNode                 , true    , DIV)
-OP(TransposeNode           , true    , TRANSPOSE)
-OP(ExpNode                 , true    , EXP_EX)
-OP(ReduceMaxNode           , true    , TENSORFLOW_MAX_EX)
-OP(NotEqualNode            , true    , NOT_EQUAL_EX)
-OP(LogicalAndNode          , true    , LOGICAL_AND_EX)
-OP(RSQRTNode               , true    , RSQRT_EX)
-OP(ReLUNode                , true    , RELU)
-OP(ResizeBilinearNode      , true    , RESIZE_BILINEAR)
-OP(ReLU1Node               , true    , RELU1)
-OP(ReLU6Node               , true    , RELU6)
-OP(FloorNode               , true    , FLOOR)
-OP(SpaceToDepthNode        , true    , SPACE_TO_DEPTH)
-OP(L2Pool2DNode            , true    , L2_POOL_2D)
-OP(PermuteNode             , false   , NOT_AVAILABLE)
+// Internal Name           | NN API?
+OP(AddNode                 , true)
+OP(SubNode                 , true)
+OP(CastNode                , true)
+OP(Conv2DNode              , true)
+OP(DepthwiseConv2DNode     , true)
+OP(AvgPool2DNode           , true)
+OP(MaxPool2DNode           , true)
+OP(ConcatNode              , true)
+OP(FullyConnectedNode      , true)
+OP(ReduceSumNode           , true)
+OP(ReshapeNode             , true)
+OP(MulNode                 , true)
+OP(SoftmaxNode             , true)
+OP(SqueezeNode             , true)
+OP(StridedSliceNode        , true)
+OP(TanhNode                , true)
+OP(LogisticNode            , true)
+OP(DivNode                 , true)
+OP(TransposeNode           , true)
+OP(ExpNode                 , true)
+OP(ReduceMaxNode           , true)
+OP(NotEqualNode            , true)
+OP(LogicalAndNode          , true)
+OP(RSQRTNode               , true)
+OP(ReLUNode                , true)
+OP(ResizeBilinearNode      , true)
+OP(ReLU1Node               , true)
+OP(ReLU6Node               , true)
+OP(FloorNode               , true)
+OP(SpaceToDepthNode        , true)
+OP(L2Pool2DNode            , true)
+OP(PermuteNode             , false)
index ce995c5..7a91dee 100644 (file)
@@ -30,8 +30,8 @@ CONFIG(EXECUTOR                , std::string  , "Linear")
 
 // Auto-generate all operations
 
-#define OP(InternalName, IsNnApi, NnApiName) \
-    CONFIG(OP_BACKEND_ ## NnApiName, std::string, "acl_cl")
+#define OP(InternalName, IsNnApi) \
+    CONFIG(OP_BACKEND_ ## InternalName, std::string, "acl_cl")
 #include "model/operation/Op.lst"
 #undef OP