[locoex/customop] Initial commit for Custom Op (#4136)
author윤현식/On-Device Lab(SR)/Principal Engineer/삼성전자 <hyunsik.yoon@samsung.com>
Mon, 8 Jul 2019 07:10:50 +0000 (16:10 +0900)
committer박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 8 Jul 2019 07:10:50 +0000 (16:10 +0900)
* [locoex/customop] Initial commit for Custom Op

This is an initial commit for Custom Op. Parents for Custom Op will be added after successive PRs.

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

contrib/locoex-customop/.FORMATCHECKED [new file with mode: 0644]
contrib/locoex-customop/CMakeLists.txt [new file with mode: 0644]
contrib/locoex-customop/README.md [new file with mode: 0644]
contrib/locoex-customop/include/locoex/IR/CustomOp.h [new file with mode: 0644]
contrib/locoex-customop/src/CustomOp.cpp [new file with mode: 0644]

diff --git a/contrib/locoex-customop/.FORMATCHECKED b/contrib/locoex-customop/.FORMATCHECKED
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/contrib/locoex-customop/CMakeLists.txt b/contrib/locoex-customop/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3a3b197
--- /dev/null
@@ -0,0 +1,4 @@
+file(GLOB_RECURSE SOURCES "src/*.cpp")
+
+add_library(locoex_customop SHARED ${SOURCES})
+target_include_directories(locoex_customop PUBLIC include)
diff --git a/contrib/locoex-customop/README.md b/contrib/locoex-customop/README.md
new file mode 100644 (file)
index 0000000..5c1ca85
--- /dev/null
@@ -0,0 +1,7 @@
+# locoex_customop
+
+_locoex_customop_ is an extention of loco to enable *custom operation*.
+In this version, a *custom operation* means one of the following:
+
+1. an op that is supported by Tensorflow but not supported both by the moco and the neurun
+1. an op that is not supported by Tensorflow, moco, and the neurun
diff --git a/contrib/locoex-customop/include/locoex/IR/CustomOp.h b/contrib/locoex-customop/include/locoex/IR/CustomOp.h
new file mode 100644 (file)
index 0000000..4a543fb
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+#ifndef __LOCOEX_IR_CUSTOM_OP_H__
+#define __LOCOEX_IR_CUSTOM_OP_H__
+
+#include <memory>
+#include <cassert>
+
+namespace locoex
+{
+
+class CustomOp final // TODO inherit parents
+{
+public:
+  CustomOp() = default;
+
+  // TODO implement methods
+};
+
+} // namespace locoex
+
+#endif // __LOCOEX_IR_CUSTOM_OP_H__
diff --git a/contrib/locoex-customop/src/CustomOp.cpp b/contrib/locoex-customop/src/CustomOp.cpp
new file mode 100644 (file)
index 0000000..8a12b3d
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * 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 "locoex/IR/CustomOp.h"
+
+// TODO implement body of CustomOp