[enco] Introduce 'core' library (#1087)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 20 Aug 2018 05:19:31 +0000 (14:19 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 20 Aug 2018 05:19:31 +0000 (14:19 +0900)
This commit introduces enco core library which will hosts Android NN API
backend implementation.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
contrib/enco/CMakeLists.txt
contrib/enco/core/CMakeLists.txt [new file with mode: 0644]
contrib/enco/core/include/enco/Backend.h [new file with mode: 0644]
contrib/enco/core/src/Backend.cpp [new file with mode: 0644]

index f66e102..bbb0fe8 100644 (file)
@@ -1,2 +1,3 @@
 add_subdirectory(intf)
+add_subdirectory(core)
 add_subdirectory(cli)
diff --git a/contrib/enco/core/CMakeLists.txt b/contrib/enco/core/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e108102
--- /dev/null
@@ -0,0 +1,8 @@
+file(GLOB_RECURSE SOURCES "src/*.cpp")
+
+add_library(enco_core STATIC ${SOURCES})
+set_target_properties(enco_core PROPERTIES POSITION_INDEPENDENT_CODE ON)
+target_include_directories(enco_core PRIVATE src)
+target_include_directories(enco_core PUBLIC include)
+target_link_libraries(enco_core coco_core)
+target_link_libraries(enco_core coco_generic)
diff --git a/contrib/enco/core/include/enco/Backend.h b/contrib/enco/core/include/enco/Backend.h
new file mode 100644 (file)
index 0000000..d4531f8
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __ENCO_BACKEND_H__
+#define __ENCO_BACKEND_H__
+
+#include "coco/IR/Module.h"
+#include "coco/IR/Data.h"
+
+#include <ostream>
+
+namespace enco
+{
+
+struct Backend
+{
+public:
+  Backend(std::ostream &os) : _os(os)
+  {
+    // DO NOTHING
+  }
+
+public:
+  void compile(coco::Module *m, coco::Data *d);
+
+private:
+  std::ostream &_os;
+};
+
+} // namespace enco
+
+#endif // __ENCO_BACKEND_H__
diff --git a/contrib/enco/core/src/Backend.cpp b/contrib/enco/core/src/Backend.cpp
new file mode 100644 (file)
index 0000000..bac2348
--- /dev/null
@@ -0,0 +1,13 @@
+#include "enco/Backend.h"
+
+#include <stdexcept>
+
+namespace enco
+{
+
+void Backend::compile(coco::Module *m, coco::Data *d)
+{
+  throw std::runtime_error{"NYI; Not implemented, yet"};
+}
+
+} // namespace enco