From 6b8619b449f8abf8a0fa48f9f5113720e637bd73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=84=B8=ED=9D=AC/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 28 Oct 2019 15:35:47 +0900 Subject: [PATCH] [circle_inspect] Initial circle-inspect project (#8513) This will introduce circle-inspect project to inspect Circle model file Signed-off-by: SaeHie Park --- compiler/circle-inspect/CMakeLists.txt | 4 ++++ compiler/circle-inspect/README.md | 22 ++++++++++++++++++++++ compiler/circle-inspect/driver/Driver.cpp | 23 +++++++++++++++++++++++ compiler/circle-inspect/requires.cmake | 1 + 4 files changed, 50 insertions(+) create mode 100644 compiler/circle-inspect/CMakeLists.txt create mode 100644 compiler/circle-inspect/README.md create mode 100644 compiler/circle-inspect/driver/Driver.cpp create mode 100644 compiler/circle-inspect/requires.cmake diff --git a/compiler/circle-inspect/CMakeLists.txt b/compiler/circle-inspect/CMakeLists.txt new file mode 100644 index 0000000..70f9407 --- /dev/null +++ b/compiler/circle-inspect/CMakeLists.txt @@ -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 index 0000000..1f76c8e --- /dev/null +++ b/compiler/circle-inspect/README.md @@ -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 index 0000000..2430132 --- /dev/null +++ b/compiler/circle-inspect/driver/Driver.cpp @@ -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 + +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 index 0000000..3d1ca09 --- /dev/null +++ b/compiler/circle-inspect/requires.cmake @@ -0,0 +1 @@ +require("safemain") -- 2.7.4