15#include "llvm/Config/config.h"
16#include "llvm/Config/llvm-config.h"
31#if LLVM_ENABLE_THREADS == 0 || \
32 (!defined(_WIN32) && !defined(HAVE_PTHREAD_H))
53static int computeHostNumHardwareThreads();
58 if (MaxThreadCount <= 0)
61 return MaxThreadCount;
85const std::optional<unsigned> llvm::thread::DefaultStackSize = 8 * 1024 * 1024;
90const std::optional<unsigned> llvm::thread::DefaultStackSize = 4 * 1024 * 1024;
92const std::optional<unsigned> llvm::thread::DefaultStackSize;
98std::optional<ThreadPoolStrategy>
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
bool getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
constexpr bool empty() const
empty - Check if the string is empty.
This tells how a thread pool will be used.
unsigned ThreadsRequested
unsigned compute_thread_count() const
Retrieves the max available threads for the current strategy.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This is an optimization pass for GlobalISel generic memory operations.
ThreadPoolStrategy hardware_concurrency(unsigned ThreadCount=0)
Returns a default thread strategy where all available hardware resources are to be used,...
llvm::BitVector get_thread_affinity_mask()
Returns a mask that represents on which hardware thread, core, CPU, NUMA group, the calling thread ca...
uint32_t get_max_thread_name_length()
Get the maximum length of a thread name on this platform.
void set_thread_name(const Twine &Name)
Set the name of the current thread.
void get_thread_name(SmallVectorImpl< char > &Name)
Get the name of the current thread.
int get_physical_cores()
Returns how many physical cores (as opposed to logical cores returned from thread::hardware_concurren...
std::optional< ThreadPoolStrategy > get_threadpool_strategy(StringRef Num, ThreadPoolStrategy Default={})
Build a strategy from a number of threads as a string provided in Num.
uint64_t get_threadid()
Return the current thread id, as used in various OS system calls.
@ Default
The result values are uniform if and only if all operands are uniform.