From ea9efcb028e74f6ecd010ba06430ab07f6118538 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: Thu, 7 Nov 2019 15:26:37 +0900 Subject: [PATCH] [tfl-verify] dummy driver (#8825) This will introduce tfl-verify dummy driver from circle-verify Signed-off-by: SaeHie Park --- compiler/tfl-verify/CMakeLists.txt | 7 ++++++ compiler/tfl-verify/requires.cmake | 3 +++ compiler/tfl-verify/src/Driver.cpp | 48 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 compiler/tfl-verify/CMakeLists.txt create mode 100644 compiler/tfl-verify/requires.cmake create mode 100644 compiler/tfl-verify/src/Driver.cpp diff --git a/compiler/tfl-verify/CMakeLists.txt b/compiler/tfl-verify/CMakeLists.txt new file mode 100644 index 0000000..f9fcc5c --- /dev/null +++ b/compiler/tfl-verify/CMakeLists.txt @@ -0,0 +1,7 @@ +file(GLOB_RECURSE SOURCES "src/*.cpp") + +add_executable(tfl-verify ${SOURCES}) +target_include_directories(tfl-verify PRIVATE src) +target_link_libraries(tfl-verify safemain) +target_link_libraries(tfl-verify cwrap) +target_link_libraries(tfl-verify stdex) diff --git a/compiler/tfl-verify/requires.cmake b/compiler/tfl-verify/requires.cmake new file mode 100644 index 0000000..bd5d02a --- /dev/null +++ b/compiler/tfl-verify/requires.cmake @@ -0,0 +1,3 @@ +require("safemain") +require("cwrap") +require("stdex") diff --git a/compiler/tfl-verify/src/Driver.cpp b/compiler/tfl-verify/src/Driver.cpp new file mode 100644 index 0000000..d3562eb --- /dev/null +++ b/compiler/tfl-verify/src/Driver.cpp @@ -0,0 +1,48 @@ +/* + * 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 + +#include +#include + +int entry(int argc, char **argv) +{ + if (argc != 2) + { + std::cerr << "ERROR: Failed to parse arguments" << std::endl; + std::cerr << std::endl; + std::cerr << "USAGE: " << argv[0] << " [tflite]" << std::endl; + return 255; + } + + std::string model_file = argv[argc - 1]; + + std::cout << "[ RUN ] Check " << model_file << std::endl; + + auto result = -1; + + if (result == 0) + { + std::cout << "[ PASS ] Check " << model_file << std::endl; + } + else + { + std::cout << "[ FAIL ] Check " << model_file << std::endl; + } + + return result; +} -- 2.7.4