class ThreadPoolStrategy
Declaration
class ThreadPoolStrategy { /* full declaration omitted */ };
Description
This tells how a thread pool will be used
Declared at: llvm/include/llvm/Support/Threading.h:116
Member Variables
- public unsigned int ThreadsRequested = 0
- public bool UseHyperThreads = true
- public bool Limit = false
Method Overview
- public void apply_thread_strategy(unsigned int ThreadPoolNum) const
- public Optional<unsigned int> compute_cpu_socket(unsigned int ThreadPoolNum) const
- public unsigned int compute_thread_count() const
Methods
¶void apply_thread_strategy(
unsigned int ThreadPoolNum) const
void apply_thread_strategy(
unsigned int ThreadPoolNum) const
Description
Assign the current thread to an ideal hardware CPU or NUMA node. In a multi-socket system, this ensures threads are assigned to all CPU sockets. \p ThreadPoolNum represents a number bounded by [0, compute_thread_count()).
Declared at: llvm/include/llvm/Support/Threading.h:140
Parameters
- unsigned int ThreadPoolNum
¶Optional<unsigned int> compute_cpu_socket(
unsigned int ThreadPoolNum) const
Optional<unsigned int> compute_cpu_socket(
unsigned int ThreadPoolNum) const
Description
Finds the CPU socket where a thread should go. Returns 'None' if the thread shall remain on the actual CPU socket.
Declared at: llvm/include/llvm/Support/Threading.h:144
Parameters
- unsigned int ThreadPoolNum
¶unsigned int compute_thread_count() const
unsigned int compute_thread_count() const
Description
Retrieves the max available threads for the current strategy. This accounts for affinity masks and takes advantage of all CPU sockets.
Declared at: llvm/include/llvm/Support/Threading.h:134