blob: 579fdb3e5ab84c29f11b41a1a3240eb97d7394b7 [file] [edit]
From 2609a35a4a1a4e71c8c5702bed5be28ffc9c7b56 Mon Sep 17 00:00:00 2001
From: TFLite Patcher <tflite@localhost>
Date: Fri, 18 Oct 2024 17:58:05 +0800
Subject: [PATCH] Force enable NnApiDelegate for ChromeOS.
PATCH_NAME=nnapi-delegate
---
tensorflow/lite/BUILD | 2 ++
tensorflow/lite/tools/evaluation/utils.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/tensorflow/lite/BUILD b/tensorflow/lite/BUILD
index 07d4435c..d4993082 100644
--- a/tensorflow/lite/BUILD
+++ b/tensorflow/lite/BUILD
@@ -562,6 +562,8 @@ cc_library_with_tflite(
"//tensorflow/lite/core/api",
"//tensorflow/lite/core/api:verifier",
"//tensorflow/lite/core/c:common",
+ "//tensorflow/lite/delegates/nnapi:nnapi_delegate",
+ "//tensorflow/lite/nnapi:nnapi_implementation",
"//tensorflow/lite/experimental/resource",
"//tensorflow/lite/internal:signature_def",
"//tensorflow/lite/profiling:root_profiler",
diff --git a/tensorflow/lite/tools/evaluation/utils.h b/tensorflow/lite/tools/evaluation/utils.h
index ed89f609..201564cd 100644
--- a/tensorflow/lite/tools/evaluation/utils.h
+++ b/tensorflow/lite/tools/evaluation/utils.h
@@ -27,6 +27,7 @@ limitations under the License.
#define TFLITE_SUPPORTS_NNAPI_DELEGATE 1
#define TFLITE_SUPPORTS_GPU_DELEGATE 1
#elif defined(CL_DELEGATE_NO_GL)
+#define TFLITE_SUPPORTS_NNAPI_DELEGATE 1
#define TFLITE_SUPPORTS_GPU_DELEGATE 1
#endif // defined(__ANDROID__)
#endif // TFLITE_WITH_STABLE_ABI