Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Multithread support #7

Open
j1nx opened this issue Dec 9, 2022 · 2 comments
Open

Multithread support #7

j1nx opened this issue Dec 9, 2022 · 2 comments

Comments

@j1nx
Copy link

j1nx commented Dec 9, 2022

Looking at CPU resources while running the inference, only 1 CPU seems to be used on a rpi4.

Is it a possibility to add multithread support?

@nyadla-sys
Copy link
Contributor

nyadla-sys commented Dec 9, 2022

  //enable multithreading
  const auto processor_count = std:: thread ::hardware_concurrency();
  interpreter->SetNumThreads(processor_count);

//For more details refer this link

Sets the number of threads used by the interpreter and available to CPU kernels. If not set, the interpreter will use an implementation-dependent default number of threads. Currently, only a subset of kernels, such as conv, support multi-threading. num_threads should be >= -1. Setting num_threads to 0 has the effect to disable multithreading, which is equivalent to setting num_threads to 1. If set to the value -1, the number of threads used will be implementation-defined and platform-dependent.

@nyadla-sys
Copy link
Contributor

Please update steps in README to run tflite on the Raspberry Pi 4 if you wish.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants