From 5e277d5e246ad4be8e1eb3586255a8b26b7e4772 Mon Sep 17 00:00:00 2001
From: j1nx
Date: Fri, 20 Jan 2023 14:57:19 +0100
Subject: [PATCH] Add multithread support to Whisper-tflite
---
.../0003-Multithread-support.patch | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 buildroot-external/package/whisper-tflite/0003-Multithread-support.patch
diff --git a/buildroot-external/package/whisper-tflite/0003-Multithread-support.patch b/buildroot-external/package/whisper-tflite/0003-Multithread-support.patch
new file mode 100644
index 00000000..c3cacc3e
--- /dev/null
+++ b/buildroot-external/package/whisper-tflite/0003-Multithread-support.patch
@@ -0,0 +1,25 @@
+From 624f7abc65cf1dee85d803c398b36a9b35106720 Mon Sep 17 00:00:00 2001
+From: j1nx
+Date: Fri, 20 Jan 2023 14:22:23 +0100
+Subject: [PATCH 1/1] Multithread support
+
+---
+ tflite_minimal/minimal.cc | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/tflite_minimal/minimal.cc b/tflite_minimal/minimal.cc
+index 82e9b11..e7d0187 100644
+--- a/tflite_minimal/minimal.cc
++++ b/tflite_minimal/minimal.cc
+@@ -186,6 +186,8 @@ int main(int argc, char* argv[]) {
+ tflite::InterpreterBuilder builder(*model, resolver);
+ std::unique_ptr interpreter;
+ builder(&interpreter);
++ const auto processor_count = std:: thread ::hardware_concurrency();
++ interpreter->SetNumThreads(processor_count);
+ TFLITE_MINIMAL_CHECK(interpreter != nullptr);
+
+ // Allocate tensor buffers.
+--
+2.34.1
+