LLVM  13.0.0git
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
Threading.h File Reference
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/FunctionExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Compiler.h"
#include <ciso646>
#include <functional>
#include <mutex>
Include dependency graph for Threading.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  llvm::ThreadPoolStrategy
 This tells how a thread pool will be used. More...






typedef std::once_flag llvm::once_flag


enum  llvm::ThreadPriority { llvm::ThreadPriority::Background = 0, llvm::ThreadPriority::Default = 1 }
enum  llvm::SetThreadPriorityResult { llvm::SetThreadPriorityResult::FAILURE, llvm::SetThreadPriorityResult::SUCCESS }
 If priority is Background tries to lower current threads priority such that it does not affect foreground tasks significantly. More...


bool llvm::llvm_is_multithreaded ()
 Returns true if LLVM is compiled with support for multi-threading, and false otherwise. More...
void llvm::llvm_execute_on_thread (void(*UserFn)(void *), void *UserData, llvm::Optional< unsigned > StackSizeInBytes=llvm::None)
 Execute the given UserFn on a separate thread, passing it the provided UserData and waits for thread completion. More...
void llvm::llvm_execute_on_thread_async (llvm::unique_function< void()> Func, llvm::Optional< unsigned > StackSizeInBytes=llvm::None)
 Schedule the given Func for execution on a separate thread, then return to the caller immediately. More...
template<typename Function , typename... Args>
void llvm::call_once (once_flag &flag, Function &&F, Args &&... ArgList)
 Execute the function specified as a parameter once. More...
Optional< ThreadPoolStrategyllvm::get_threadpool_strategy (StringRef Num, ThreadPoolStrategy Default={})
 Build a strategy from a number of threads as a string provided in Num. More...
ThreadPoolStrategy llvm::heavyweight_hardware_concurrency (unsigned ThreadCount=0)
 Returns a thread strategy for tasks requiring significant memory or other resources. More...
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(). More...
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. More...
ThreadPoolStrategy llvm::optimal_concurrency (unsigned TaskCount=0)
 Returns an optimal thread strategy to execute specified amount of tasks. More...
uint64_t llvm::get_threadid ()
 Return the current thread id, as used in various OS system calls. More...
uint32_t llvm::get_max_thread_name_length ()
 Get the maximum length of a thread name on this platform. More...
void llvm::set_thread_name (const Twine &Name)
 Set the name of the current thread. More...
void llvm::get_thread_name (SmallVectorImpl< char > &Name)
 Get the name of the current thread. More...
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. More...
unsigned llvm::get_cpus ()
 Returns how many physical CPUs or NUMA groups the system has. More...
SetThreadPriorityResult llvm::set_thread_priority (ThreadPriority Priority)

Macro Definition Documentation



Definition at line 37 of file Threading.h.