[nnkit/moco/tf] backend of nnkit (#3444)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Mon, 13 May 2019 09:13:37 +0000 (18:13 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 13 May 2019 09:13:37 +0000 (18:13 +0900)
* [nnkit/moco/tf] backend of nnkit

This commit adds backend of nnkit for nnkit/moco/tf.

Signed-off-by: Hyun Sik Yoon <hyunsik.yoon@samsung.com>
* indentation

contrib/nnkit/backends/moco/CMakeLists.txt [new file with mode: 0644]
contrib/nnkit/backends/moco/tf/Backend.cpp [new file with mode: 0644]
contrib/nnkit/backends/moco/tf/CMakeLists.txt [new file with mode: 0644]

diff --git a/contrib/nnkit/backends/moco/CMakeLists.txt b/contrib/nnkit/backends/moco/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5ea6cda
--- /dev/null
@@ -0,0 +1 @@
+add_subdirectories()
diff --git a/contrib/nnkit/backends/moco/tf/Backend.cpp b/contrib/nnkit/backends/moco/tf/Backend.cpp
new file mode 100644 (file)
index 0000000..4900684
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * 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 "nnkit/support/moco/tf/Backend.h"
+
+#include <nnkit/CmdlineArguments.h>
+#include <stdex/Memory.h>
+
+#include <cassert>
+
+extern "C" std::unique_ptr<nnkit::Backend> make_backend(const nnkit::CmdlineArguments &args)
+{
+  using stdex::make_unique;
+
+  assert(args.size() == 2); // args.at[0] : *.pb path, args.at[1]: *.info path
+
+  return make_unique<::nnkit::support::moco::tf::Backend>(args.at(0), args.at(1));
+}
diff --git a/contrib/nnkit/backends/moco/tf/CMakeLists.txt b/contrib/nnkit/backends/moco/tf/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7608e5c
--- /dev/null
@@ -0,0 +1,7 @@
+if(NOT TARGET nnkit_support_moco_tf)
+  return()
+endif(NOT TARGET nnkit_support_moco_tf)
+
+add_library(nnkit_moco_tf_backend SHARED Backend.cpp)
+target_link_libraries(nnkit_moco_tf_backend nnkit_support_moco_tf)
+target_link_libraries(nnkit_moco_tf_backend stdex)