mirror of
https://github.com/OpenVoiceOS/OpenVoiceOS
synced 2025-02-09 16:38:39 +01:00
26 lines
823 B
Diff
26 lines
823 B
Diff
From 624f7abc65cf1dee85d803c398b36a9b35106720 Mon Sep 17 00:00:00 2001
|
|
From: j1nx <p.steenbergen@j1nx.nl>
|
|
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<tflite::Interpreter> 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
|
|
|