[nnfw] Fix meson
authorParichay Kapoor <pk.kapoor@samsung.com>
Fri, 8 Nov 2019 06:48:08 +0000 (15:48 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 15 Nov 2019 12:29:01 +0000 (21:29 +0900)
Fix variables in meson.build for nnfw and nnfw-runtime

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
ext/nnstreamer/tensor_filter/meson.build
ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc
ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.h
meson.build
meson_options.txt

index e362a61..c0d721e 100644 (file)
@@ -74,10 +74,10 @@ if get_option('enable-tensorflow-lite')
 
   nnstreamer_filter_tflite_deps = [tflite_dep, thread_dep, libdl_dep, glib_dep, gst_dep, nnstreamer_dep]
 
-  if get_option('enable-nnfw')
-    nnapi_lib = dependency('nnfw', required: true)
-    if nnapi_lib.found()
-      nnstreamer_filter_tflite_deps += nnapi_lib
+  if get_option('enable-tflite-nnapi-delegation')
+    nnfw_nnapi_lib = dependency('nnfw', required: true)
+    if nnfw_nnapi_lib.found()
+      nnstreamer_filter_tflite_deps += nnfw_nnapi_lib
     else
       error('Cannot find nnfw')
     endif
index cf25949..e0e0fa5 100644 (file)
@@ -142,7 +142,7 @@ TFLiteCore::loadModel ()
 
     interpreter->UseNNAPI(use_nnapi);
 
-#ifdef ENABLE_NNFW
+#ifdef ENABLE_TFLITE_NNAPI_DELEGATE
     if (use_nnapi) {
       nnfw_delegate.reset (new ::nnfw::tflite::NNAPIDelegate);
       if (nnfw_delegate->BuildGraph (interpreter.get()) != kTfLiteOk) {
@@ -409,7 +409,7 @@ TFLiteCore::invoke (const GstTensorMemory * input, GstTensorMemory * output)
     tensors_idx.push_back (tensor_idx);
   }
 
-#ifdef ENABLE_NNFW
+#ifdef ENABLE_TFLITE_NNAPI_DELEGATE
   if (use_nnapi)
     status = nnfw_delegate->Invoke (interpreter.get());
   else
index 60ea819..cf597ad 100644 (file)
@@ -33,7 +33,7 @@
 #include <tensorflow/contrib/lite/model.h>
 #include <tensorflow/contrib/lite/kernels/register.h>
 
-#ifdef ENABLE_NNFW
+#ifdef ENABLE_TFLITE_NNAPI_DELEGATE
 #include "tflite/ext/nnapi_delegate.h"
 #endif
 
@@ -68,7 +68,7 @@ private:
   std::unique_ptr <tflite::Interpreter> interpreter;
   std::unique_ptr <tflite::FlatBufferModel> model;
 
-#ifdef ENABLE_NNFW
+#ifdef ENABLE_TFLITE_NNAPI_DELEGATE
   std::unique_ptr <nnfw::tflite::NNAPIDelegate> nnfw_delegate;
 #endif
 
index ac106ab..28642a2 100644 (file)
@@ -232,11 +232,16 @@ if get_option('enable-python')
   endif
 endif
 
-# nnfw ( details in https://review.tizen.org/gerrit/p/platform/core/ml/nnfw )
-if get_option('enable-nnfw')
-  add_project_arguments('-DENABLE_NNFW=1', language: ['c', 'cpp'])
-  # For tf-lite/nnapi, enable-nnfw allows to use nnfw as a backend.
-  # This also enables nnfw as a subplugin for Tizen.
+# nnfw-runtime ( details in https://review.tizen.org/gerrit/p/platform/core/ml/nnfw )
+if get_option('enable-nnfw-runtime')
+  add_project_arguments('-DENABLE_NNFW_RUNTIME=1', language: ['c', 'cpp'])
+  # This enables nnfw as a subplugin for Tizen.
+endif
+
+# nnfw-runtime ( details in https://review.tizen.org/gerrit/p/platform/core/ml/nnfw )
+if get_option('enable-tflite-nnapi-delegation')
+  add_project_arguments('-DENABLE_TFLITE_NNAPI_DELEGATION=1', language: ['c', 'cpp'])
+  # For tf-lite/nnapi, enable-nnfw allows to use nnfw::tflite::nnapi as a backend.
 endif
 
 # Build nnstreamer (common, plugins)
index f69e03a..3be1043 100644 (file)
@@ -17,7 +17,7 @@ option('enable-python', type: 'boolean', value: true)
 option('enable-tizen', type: 'boolean', value: false)
 option('enable-element-restriction', type: 'boolean', value: false) # true to restrict gst-elements in api
 option('restricted-elements', type: 'string', value: '')
-option('enable-nnfw', type: 'boolean', value: false)
-option('enable-nnfw-runtime', type: 'boolean', value: false)
+option('enable-tflite-nnapi-delegation', type: 'boolean', value: false) # true to enable tensorflow-lite to delegate nnapi interpretation to nnfw backend in tizen
+option('enable-nnfw-runtime', type: 'boolean', value: false) # true to enable nnfw tensor filter element
 option('enable-cppfilter', type: 'boolean', value: true)
 option('enable-tizen-sensor', type: 'boolean', value: false)