Go to the documentation of this file.
16 #include "llvm/Config/config.h"
32 #if LLVM_ENABLE_THREADS != 0
39 #if LLVM_ENABLE_THREADS == 0 || \
40 (!defined(_WIN32) && !defined(HAVE_PTHREAD_H))
63 if (MaxThreadCount <= 0)
66 return MaxThreadCount;
85 #if defined(__APPLE__)
114 S.ThreadsRequested = V;
unsigned compute_thread_count() const
Retrieves the max available threads for the current strategy.
ThreadPoolStrategy hardware_concurrency(unsigned ThreadCount=0)
Returns a default thread strategy where all available hardware resources are to be used,...
This is an optimization pass for GlobalISel generic memory operations.
This tells how a thread pool will be used.
int computeHostNumHardwareThreads()
uint64_t get_threadid()
Return the current thread id, as used in various OS system calls.
uint32_t get_max_thread_name_length()
Get the maximum length of a thread name on this platform.
void get_thread_name(SmallVectorImpl< char > &Name)
Get the name of the current thread.
std::enable_if_t< std::numeric_limits< T >::is_signed, bool > getAsInteger(unsigned Radix, T &Result) const
Parse the current string as an integer of the specified radix.
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Optional< ThreadPoolStrategy > get_threadpool_strategy(StringRef Num, ThreadPoolStrategy Default={})
Build a strategy from a number of threads as a string provided in Num.
unsigned ThreadsRequested
int getHostNumPhysicalCores()
Get the number of physical cores (as opposed to logical cores returned from thread::hardware_concurre...
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
StringRef - Represent a constant reference to a string, i.e.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
static const llvm::Optional< unsigned > DefaultStackSize
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
void set_thread_name(const Twine &Name)
Set the name of the current thread.
bool llvm_is_multithreaded()
Returns true if LLVM is compiled with support for multi-threading, and false otherwise.
llvm::BitVector get_thread_affinity_mask()
Returns a mask that represents on which hardware thread, core, CPU, NUMA group, the calling thread ca...