#include "llvm/Support/Atomic.h"">

LLVM: include/llvm/Support/Threading.h File Reference (original) (raw)

#include "[llvm/ADT/BitVector.h](BitVector%5F8h%5Fsource.html)"
#include "[llvm/ADT/StringRef.h](StringRef%5F8h%5Fsource.html)"
#include "llvm/Config/llvm-config.h"
#include "[llvm/Support/Compiler.h](Compiler%5F8h%5Fsource.html)"
#include <optional>
#include "[llvm/Support/Atomic.h](Support%5F2Atomic%5F8h%5Fsource.html)"

Go to the source code of this file.

Namespaces
namespace llvm
This is an optimization pass for GlobalISel generic memory operations.
Macros
#define LLVM_THREADING_USE_STD_CALL_ONCE 1
Functions
constexpr bool llvm::llvm_is_multithreaded ()
Returns true if LLVM is compiled with support for multi-threading, and false otherwise.
template<typename Function, typename... Args>
void llvm::call_once (once_flag &flag, Function &&F, Args &&... ArgList)
Execute the function specified as a parameter once.
LLVM_ABI std::optional< ThreadPoolStrategy > llvm::get_threadpool_strategy (StringRef Num, ThreadPoolStrategy Default={})
Build a strategy from a number of threads as a string provided in Num.
ThreadPoolStrategy llvm::heavyweight_hardware_concurrency (unsigned ThreadCount=0)
Returns a thread strategy for tasks requiring significant memory or other resources.
ThreadPoolStrategy llvm::heavyweight_hardware_concurrency (StringRef Num)
Like heavyweight_hardware_concurrency() above, but builds a strategy based on the rules described for get_threadpool_strategy().
ThreadPoolStrategy llvm::hardware_concurrency (unsigned ThreadCount=0)
Returns a default thread strategy where all available hardware resources are to be used, except for those initially excluded by an affinity mask.
ThreadPoolStrategy llvm::hardware_concurrency (StringRef Num)
Like hardware_concurrency() above, but builds a strategy based on the rules described for get_threadpool_strategy().
ThreadPoolStrategy llvm::optimal_concurrency (unsigned TaskCount=0)
Returns an optimal thread strategy to execute specified amount of tasks.
ThreadPoolStrategy llvm::jobserver_concurrency ()
Returns a thread strategy that attempts to coordinate with a GNU Make jobserver.
LLVM_ABI uint64_t llvm::get_threadid ()
Return the current thread id, as used in various OS system calls.
LLVM_ABI uint32_t llvm::get_max_thread_name_length ()
Get the maximum length of a thread name on this platform.
LLVM_ABI void llvm::set_thread_name (const Twine &Name)
Set the name of the current thread.
LLVM_ABI void llvm::get_thread_name (SmallVectorImpl< char > &Name)
Get the name of the current thread.
LLVM_ABI llvm::BitVector llvm::get_thread_affinity_mask ()
Returns a mask that represents on which hardware thread, core, CPU, NUMA group, the calling thread can be executed.
LLVM_ABI unsigned llvm::get_cpus ()
Returns how many physical CPUs or NUMA groups the system has.
LLVM_ABI int llvm::get_physical_cores ()
Returns how many physical cores (as opposed to logical cores returned from thread::hardware_concurrency(), which includes hyperthreads).
LLVM_ABI SetThreadPriorityResult llvm::set_thread_priority (ThreadPriority Priority)

LLVM_THREADING_USE_STD_CALL_ONCE

#define LLVM_THREADING_USE_STD_CALL_ONCE 1