This patch adds tizen-npumanager dependency.
It's used only when 'vd_npumgr' option is provided.
Otherwise, dummy npumgr module is used.
Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
option('enable_npu_emul', type : 'boolean', value : false)
option('enable_data_manip', type : 'boolean', value : false)
option('enable_buffering', type : 'boolean', value : false)
+option('enable_vd_npumgr', type : 'boolean', value : false)
option('kernel_hdr_dir', type : 'string', value : '')
%define enable_npu_emul -Denable_npu_emul=false
%endif
+%if 0%{?vd_npumgr}
+BuildRequires: tizen-npumanager-devel
+%define enable_vd_npumgr -Denable_vd_npumgr=true
+%else
+%define enable_vd_npumgr -Denable_vd_npumgr=false
+%endif
+
%global debug_package %{nil}
%global __debug_install_post %{nil}
meson --buildtype=plain --bindir=%{neexampledir} --prefix=%{_prefix} \
--libdir=%{_libdir} --includedir=%{_includedir} \
--datadir=%{_datadir} --sysconfdir=%{_sysconfdir} \
- -Dtarget_platform=tizen -Denable_data_manip=true %{enable_npu_emul} \
+ -Dtarget_platform=tizen -Denable_data_manip=true \
+ %{enable_npu_emul} %{enable_vd_npumgr} \
build
ninja -C build %{?_smp_mflags}
--- /dev/null
+# Note that VD NPU Manager is a gdbus-based thread application
+gmodule_dep = dependency('gmodule-2.0', required: false)
+giounix_dep = dependency('gio-unix-2.0', required: false)
+if gmodule_dep.found() and giounix_dep.found()
+ npumgr_deps = [
+ glib_dep,
+ gmodule_dep,
+ giounix_dep
+ ]
+
+ if target_platform == 'tizen'
+ npumgr_deps += dependency('dlog')
+ endif
+
+ npumgr_lib = shared_library ('npumgr',
+ 'npumgr_api.cc',
+ dependencies: npumgr_deps,
+ build_rpath : ne_libdir,
+ install : true,
+ install_rpath : ne_libdir,
+ install_dir : ne_libdir
+ )
+ npumgr_dep = declare_dependency (link_with : npumgr_lib,
+ include_directories : include_directories('.')
+ )
+
+ npumgr_triv2_lib = shared_library ('npumgr_triv2',
+ ['npumgr_triv2.cc', 'npumgr_device.cc'],
+ include_directories : [ne_common_inc, ne_host_inc],
+ dependencies: npumgr_deps,
+ link_with : ne_library_shared,
+ build_rpath : ne_libdir,
+ install : true,
+ install_rpath : ne_libdir,
+ install_dir : ne_libdir
+ )
+
+ executable ('dummy_npumgr',
+ ['npumgr.cc', 'npumgr_device.cc'],
+ dependencies: npumgr_deps,
+ install : true,
+ install_rpath : ne_libdir,
+ install_dir : join_paths(ne_bindir, 'apptests', 'npumgr')
+ )
+
+ install_data ('sr.odl.NPUManager.conf',
+ install_dir: join_paths(get_option('datadir'), 'dbus-1', 'system.d')
+ )
+endif
*/
#include "npumgr_api.h"
-#include "npumgr_common.h"
+#include "../npumgr_common.h"
#include <stdio.h>
#include <stdlib.h>
-# Note that VD NPU Manager is a gdbus-based thread application
glib_dep = dependency('glib-2.0', required: false)
-gmodule_dep = dependency('gmodule-2.0', required: false)
-giounix_dep = dependency('gio-unix-2.0', required: false)
-if glib_dep.found() and giounix_dep.found()
- npumgr_deps = [
- glib_dep,
- gmodule_dep,
- giounix_dep
- ]
-
- if target_platform == 'tizen'
- npumgr_deps += dependency('dlog')
+if glib_dep.found()
+ if get_option('enable_vd_npumgr')
+ # vd npu manager
+ npumgr_dep = dependency('tizen-npumanager')
+ else
+ # dummy npu manager
+ subdir('dummy')
endif
- npumgr_lib = shared_library ('npumgr',
- 'npumgr_api.cc',
- dependencies: npumgr_deps,
- build_rpath : ne_libdir,
- install : true,
- install_rpath : ne_libdir,
- install_dir : ne_libdir
- )
-
- npumgr_triv2_lib = shared_library ('npumgr_triv2',
- ['npumgr_triv2.cc', 'npumgr_device.cc'],
- include_directories : [ne_common_inc, ne_host_inc],
- dependencies: npumgr_deps,
- link_with : ne_library_shared,
- build_rpath : ne_libdir,
- install : true,
- install_rpath : ne_libdir,
- install_dir : ne_libdir
- )
-
+ # npu manager test program
executable ('apptest_npumgr',
'npumgr_test.cc',
- dependencies : [glib_dep, ne_test_utils_common_dep],
- link_with : npumgr_lib,
- install : true,
- install_rpath : ne_libdir,
- install_dir : join_paths(ne_bindir, 'apptests', 'npumgr')
- )
-
- executable ('dummy_npumgr',
- ['npumgr.cc', 'npumgr_device.cc'],
- dependencies: npumgr_deps,
+ dependencies : [glib_dep, ne_test_utils_common_dep, npumgr_dep],
install : true,
install_rpath : ne_libdir,
install_dir : join_paths(ne_bindir, 'apptests', 'npumgr')
)
-
- install_data ('sr.odl.NPUManager.conf',
- install_dir: join_paths(get_option('datadir'), 'dbus-1', 'system.d')
- )
endif
#include <glib.h>
#include <ne_test_utils_common.h>
-#include "npumgr_api.h"
+#include <npumgr_api.h>
#include "npumgr_common.h"
using namespace std;