File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
examples/portable/executor_runner Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 4141#if defined(ET_USE_THREADPOOL)
4242#include < executorch/extension/threadpool/cpuinfo_utils.h>
4343#include < executorch/extension/threadpool/threadpool.h>
44+ #include < executorch/extension/threadpool/threadpool_guard.h>
45+
46+ #include < optional>
4447#endif
4548
4649static uint8_t method_allocator_pool[4 * 1024U * 1024U ]; // 4 MB
@@ -163,6 +166,11 @@ int main(int argc, char** argv) {
163166 ::executorch::extension::threadpool::get_threadpool ()
164167 ->_unsafe_reset_threadpool(num_performant_cores);
165168 }
169+ std::optional<::executorch::extension::threadpool::NoThreadPoolGuard>
170+ opt_guard;
171+ if (cpu_threads == 1 ) {
172+ opt_guard.emplace ();
173+ }
166174#endif // ET_USE_THREADPOOL
167175 // Create a loader to get the data of the program file. There are other
168176 // DataLoaders that use mmap() or point to data that's already in memory, and
You can’t perform that action at this time.
0 commit comments