[circle_inspect] Initial circle-inspect project (#8513)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Mon, 28 Oct 2019 06:35:47 +0000 (15:35 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 28 Oct 2019 06:35:47 +0000 (15:35 +0900)
This will introduce circle-inspect project to inspect Circle model file

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/circle-inspect/CMakeLists.txt [new file with mode: 0644]
compiler/circle-inspect/README.md [new file with mode: 0644]
compiler/circle-inspect/driver/Driver.cpp [new file with mode: 0644]
compiler/circle-inspect/requires.cmake [new file with mode: 0644]

diff --git a/compiler/circle-inspect/CMakeLists.txt b/compiler/circle-inspect/CMakeLists.txt
new file mode 100644 (file)
index 0000000..70f9407
--- /dev/null
@@ -0,0 +1,4 @@
+set(DRIVER "driver/Driver.cpp")
+
+add_executable(circle-inspect ${DRIVER})
+target_link_libraries(circle-inspect safemain)
diff --git a/compiler/circle-inspect/README.md b/compiler/circle-inspect/README.md
new file mode 100644 (file)
index 0000000..1f76c8e
--- /dev/null
@@ -0,0 +1,22 @@
+# circle-inspect
+
+_circle-inspect_ allows users to retrieve various information from a Circle model file
+
+## Information to inspect
+
+Operators with `--operators`
+- show operator codes one line at a time in execution order
+
+Example
+```
+$ circle-inspect --operators model.circle
+```
+
+Result
+```
+RESHAPE
+DEPTHWISE_CONV_2D
+ADD
+```
+
+To get the count of specific operator, use other tools like sort, uniq, etc.
diff --git a/compiler/circle-inspect/driver/Driver.cpp b/compiler/circle-inspect/driver/Driver.cpp
new file mode 100644 (file)
index 0000000..2430132
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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 <stdexcept>
+
+int entry(int argc, char **argv)
+{
+  throw std::runtime_error("NYI");
+  return 0;
+}
diff --git a/compiler/circle-inspect/requires.cmake b/compiler/circle-inspect/requires.cmake
new file mode 100644 (file)
index 0000000..3d1ca09
--- /dev/null
@@ -0,0 +1 @@
+require("safemain")