MCPcopy Create free account
hub / github.com/ARM-software/armnn / SetNumberOfThreads

Method SetNumberOfThreads

src/backends/neon/NeonWorkloadFactory.cpp:54–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void NeonWorkloadFactory::SetNumberOfThreads()
55{
56 if (m_ModelContextPtr)
57 {
58 const unsigned int MIN_THREADS = 1;
59 const unsigned int MAX_THREADS = 64;
60
61 // Set the number of threads to be used if the user has set NumberOfThreads param
62 // Only set if within limit or valid input
63 auto modelOptions = dynamic_cast<NeonBackendModelContext*>(m_ModelContextPtr.get());
64 auto numberOfThreads = modelOptions->GetNumberOfThreads();
65
66 modelOptions->ApplyAclIsaPolicy();
67
68 if (numberOfThreads != 0 && numberOfThreads >= MIN_THREADS && numberOfThreads <= MAX_THREADS)
69 {
70 arm_compute::Scheduler::get().set_num_threads(numberOfThreads);
71 }
72 }
73}
74
75NeonWorkloadFactory::NeonWorkloadFactory(const std::shared_ptr<NeonMemoryManager>& memoryManager)
76 : m_MemoryManager(memoryManager), m_ModelContextPtr(IBackendInternal::IBackendSpecificModelContextPtr{})

Callers

nothing calls this directly

Calls 5

getFunction · 0.85
GetNumberOfThreadsMethod · 0.80
ApplyAclIsaPolicyMethod · 0.80
set_num_threadsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected