$(NNTRAINER_ROOT)/nntrainer/utils/util_func.cpp \
$(NNTRAINER_ROOT)/nntrainer/utils/parse_util.cpp \
$(NNTRAINER_ROOT)/nntrainer/utils/profiler.cpp \
+ $(NNTRAINER_ROOT)/nntrainer/compiler/compiler.cpp \
$(NNTRAINER_ROOT)/nntrainer/app_context.cpp
# Add tflite backbone building
$(NNTRAINER_ROOT)/nntrainer/optimizers \
$(NNTRAINER_ROOT)/nntrainer/utils \
$(NNTRAINER_ROOT)/nntrainer/graph \
+ $(NNTRAINER_ROOT)/nntrainer/compiler \
$(NNTRAINER_ROOT)/api \
$(NNTRAINER_ROOT)/api/ccapi/include \
$(NNTRAINER_ROOT)/api/capi/include/platform
--- /dev/null
+// SPDX-License-Identifier: Apache-2.0
+/**
+ * Copyright (C) 2021 Jihoon Lee <jhoon.it.lee@samsung.com>
+ *
+ * @file compiler.cpp
+ * @date 01 April 2021
+ * @brief NNTrainer compiler that reads and generates excutable graph
+ * @see https://github.com/nnstreamer/nntrainer
+ * @author Jihoon Lee <jhoon.it.lee@samsung.com>
+ * @bug No known bugs except for NYI items
+ */
+
+#include <iostream>
+
+namespace nntrainer {
+
+void hello_world() { std::cout << "hello_world\n"; }
+
+} // namespace nntrainer
--- /dev/null
+// SPDX-License-Identifier: Apache-2.0
+/**
+ * Copyright (C) 2021 Jihoon Lee <jhoon.it.lee@samsung.com>
+ *
+ * @file compiler.h
+ * @date 01 April 2021
+ * @brief NNTrainer compiler that reads and generates excutable graph
+ * @see https://github.com/nnstreamer/nntrainer
+ * @author Jihoon Lee <jhoon.it.lee@samsung.com>
+ * @bug No known bugs except for NYI items
+ */
+
+namespace nntrainer {
+
+/**
+ * @brief a simple scaffoliding function
+ *
+ */
+void hello_world();
+
+} // namespace nntrainer
--- /dev/null
+compiler_sources = [
+ 'compiler.cpp'
+]
+
+compiler_headers = []
+
+foreach s : compiler_sources
+ nntrainer_sources += meson.current_source_dir() / s
+endforeach
+
+foreach h : compiler_headers
+ nntrainer_headers += meson.current_source_dir() / h
+endforeach
+
endif
nntrainer_elements = [
+ 'compiler',
'dataset',
'layers',
'models',
nntrainer_test_inc = include_directories('./include')
-nntrainer_test_deps = [
- nntrainer_dep
-]
nntrainer_testutil_lib = static_library(
'nntrainer_test_util',
'nntrainer_test_util.cpp',
- dependencies: [nntrainer_test_deps],
+ dependencies: [nntrainer_dep],
include_directories: nntrainer_test_inc
)
include_directories: nntrainer_test_inc
)
-nntrainer_test_deps += nntrainer_testutil_dep
-nntrainer_test_deps += gtest_dep
+nntrainer_test_deps = [
+ nntrainer_dep,
+ nntrainer_testutil_dep,
+ gtest_dep
+]
+
+nntrainer_test_main_deps = [
+ nntrainer_dep,
+ nntrainer_testutil_dep,
+ gtest_main_dep
+]
if get_option('enable-capi')
subdir('tizen_capi')
--- /dev/null
+test_target = [
+ 'unittest_compiler'
+]
+
+foreach target: test_target
+ exe = executable(
+ target,
+ target + '.cpp',
+ dependencies: nntrainer_test_main_deps,
+ install: get_option('enable-test'),
+ install_dir: application_install_dir
+ )
+ test(target, exe, args: ['--gtest_output=xml:@0@/@1@.xml'.format(meson.build_root(), target)] )
+endforeach
--- /dev/null
+// SPDX-License-Identifier: Apache-2.0
+/**
+ * Copyright (C) 2021 Jihoon Lee <jhoon.it.lee@samsung.com>
+ *
+ * @file unittest_compiler.cpp
+ * @date 01 April 2021
+ * @brief compiler test
+ * @see https://github.com/nnstreamer/nntrainer
+ * @author Jihoon Lee <jhoon.it.lee@samsung.com>
+ * @bug No known bugs except for NYI items
+ */
+
+#include <gtest/gtest.h>
+
+#include <compiler.h>
+
+TEST(scaffoldingTest, sampleTest) { EXPECT_NO_THROW(nntrainer::hello_world()); }
test(target, exe, args: ['--gtest_output=xml:@0@/@1@.xml'.format(meson.build_root(), target)] )
endforeach
+subdir('compiler')