LLVM 20.0.0git
Classes | Namespaces | Macros | Enumerations | Functions
Threading.h File Reference
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Compiler.h"
#include <ciso646>
#include <optional>
#include "llvm/Support/Atomic.h"

Go to the source code of this file.

Classes

struct  llvm::once_flag
 The llvm::once_flag structure. More...
 
class  llvm::ThreadPoolStrategy
 This tells how a thread pool will be used. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define LLVM_THREADING_USE_STD_CALL_ONCE   1
 

Enumerations

enum  llvm::InitStatus { llvm::Uninitialized = 0 , llvm::Wait = 1 , llvm::Done = 2 }
 
enum class  llvm::ThreadPriority { llvm::Background = 0 , llvm::Low = 1 , llvm::Default = 2 }
 
enum class  llvm::SetThreadPriorityResult { llvm::FAILURE , llvm::SUCCESS }
 

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.
 
std::optional< ThreadPoolStrategyllvm::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.
 
uint64_t llvm::get_threadid ()
 Return the current thread id, as used in various OS system calls.
 
uint32_t llvm::get_max_thread_name_length ()
 Get the maximum length of a thread name on this platform.
 
void llvm::set_thread_name (const Twine &Name)
 Set the name of the current thread.
 
void llvm::get_thread_name (SmallVectorImpl< char > &Name)
 Get the name of the current thread.
 
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.
 
unsigned llvm::get_cpus ()
 Returns how many physical CPUs or NUMA groups the system has.
 
int llvm::get_physical_cores ()
 Returns how many physical cores (as opposed to logical cores returned from thread::hardware_concurrency(), which includes hyperthreads).
 
SetThreadPriorityResult llvm::set_thread_priority (ThreadPriority Priority)
 

Macro Definition Documentation

◆ LLVM_THREADING_USE_STD_CALL_ONCE

#define LLVM_THREADING_USE_STD_CALL_ONCE   1

Definition at line 34 of file Threading.h.