From 2a2798e2fd2d660340746f76dd3ed7a4f82e7ed8 Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Fri, 8 Jan 2021 14:28:25 +0900 Subject: [PATCH] [SimpleShot] Add scaffolding for the application This patch adds simpleshot directory to application. Nothing's present yet just a simple structures **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Jihoon Lee --- Applications/SimpleShot/README.md | 6 ++++++ Applications/SimpleShot/meson.build | 16 ++++++++++++++++ Applications/SimpleShot/task_runner.cpp | 20 ++++++++++++++++++++ Applications/SimpleShot/test/meson.build | 17 +++++++++++++++++ Applications/SimpleShot/test/mock_test.cpp | 16 ++++++++++++++++ Applications/meson.build | 4 ++++ 6 files changed, 79 insertions(+) create mode 100644 Applications/SimpleShot/README.md create mode 100644 Applications/SimpleShot/meson.build create mode 100644 Applications/SimpleShot/task_runner.cpp create mode 100644 Applications/SimpleShot/test/meson.build create mode 100644 Applications/SimpleShot/test/mock_test.cpp diff --git a/Applications/SimpleShot/README.md b/Applications/SimpleShot/README.md new file mode 100644 index 0000000..8260b17 --- /dev/null +++ b/Applications/SimpleShot/README.md @@ -0,0 +1,6 @@ +Pratical demonstration of SimpleShot few tasks including real examples + +Reference. [Wang, Yan, et al. 2019](https://arxiv.org/abs/1911.04623) + +# How to use +TBA diff --git a/Applications/SimpleShot/meson.build b/Applications/SimpleShot/meson.build new file mode 100644 index 0000000..d92bdec --- /dev/null +++ b/Applications/SimpleShot/meson.build @@ -0,0 +1,16 @@ +simpleshot_sources = [ + 'task_runner.cpp' +] + +simpleshot_inc = include_directories('.') + +e = executable('simpleshot_runner', + simpleshot_sources, + dependencies: [app_utils_dep, nntrainer_dep, tflite_dep], + install: get_option('install-app'), + install_dir: application_install_dir +) + +if get_option('enable-test') + subdir('test') +endif diff --git a/Applications/SimpleShot/task_runner.cpp b/Applications/SimpleShot/task_runner.cpp new file mode 100644 index 0000000..170ed49 --- /dev/null +++ b/Applications/SimpleShot/task_runner.cpp @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: Apache-2.0 +/** + * Copyright (C) 2020 Jihoon Lee + * + * @file task_runner.cpp + * @date 08 Jan 2021 + * @brief task runner for the simpleshot demonstration + * @see https://github.com/nnstreamer/nntrainer + * @author Jihoon Lee + * @bug No known bugs except for NYI items + */ + +#include + +/** + * @brief main runner + * + * @return int + */ +int main(int argc, char **argv) { std::cout << "hello world\n"; } diff --git a/Applications/SimpleShot/test/meson.build b/Applications/SimpleShot/test/meson.build new file mode 100644 index 0000000..322f63b --- /dev/null +++ b/Applications/SimpleShot/test/meson.build @@ -0,0 +1,17 @@ +gtest_dep_with_main = dependency('gtest', main : true, required : false) + + +test_target = [ + 'mock_test', +] + +foreach target: test_target + exe = executable( + target, + target + '.cpp', + dependencies: gtest_dep_with_main, + install: get_option('enable-test'), + install_dir: application_install_dir + ) + test(target, exe) +endforeach diff --git a/Applications/SimpleShot/test/mock_test.cpp b/Applications/SimpleShot/test/mock_test.cpp new file mode 100644 index 0000000..676828c --- /dev/null +++ b/Applications/SimpleShot/test/mock_test.cpp @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 +/** + * Copyright (C) 2020 Jihoon Lee + * + * @file mock_test.cpp + * @date 08 Jan 2021 + * @brief mock test for simpleshot application + * @see https://github.com/nnstreamer/nntrainer + * @author Jihoon Lee + * @note this will be deleted or moved as the application is building up + * @bug No known bugs except for NYI items + */ + +#include + +TEST(sample_test, test_01_p) { EXPECT_TRUE(true); } diff --git a/Applications/meson.build b/Applications/meson.build index 947db73..65a7e89 100644 --- a/Applications/meson.build +++ b/Applications/meson.build @@ -9,3 +9,7 @@ subdir('ReinforcementLearning/DeepQ/jni') subdir('TransferLearning/CIFAR_Classification/jni') subdir('TransferLearning/Draw_Classification/jni') subdir('Custom/LayerClient/jni') + +if get_option('enable-tflite-backbone') + subdir('SimpleShot') +endif -- 2.7.4