11#include "../utility/module.hpp"
12#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
22namespace hi {
inline namespace v1 {
24#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
26#elif HI_OPERATING_SYSTEM == HI_OS_LINUX || HI_OPERATING_SYSTEM == HI_OS_MACOS
27constexpr std::size_t maximum_num_cpus = CPU_SETSIZE;
30#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
31using thread_id = uint32_t;
33using thread_id = uint64_t;
36inline thread_local thread_id current_thread_id_dummy = 0;
46#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
48 constexpr uint64_t NT_TIB_CurrentThreadID = 0x48;
49 return __readgsdword(NT_TIB_CurrentThreadID);
52 return reinterpret_cast<uint64_t
>(¤t_thread_id_dummy);
std::vector< bool > process_affinity_mask()
Get the current process CPU affinity mask.
std::string get_thread_name(thread_id id) noexcept
Get the thread name of a thread id.
void set_thread_name(std::string_view name) noexcept
Set the name of the current thread.
std::vector< bool > set_thread_affinity_mask(std::vector< bool > const &mask)
Set the current thread CPU affinity mask.
std::size_t current_cpu_id() noexcept
Get the current CPU id.
std::size_t advance_thread_affinity(std::size_t &cpu) noexcept
Advance thread affinity to the next CPU.
std::vector< bool > set_thread_affinity(std::size_t cpu_id)
Set the current thread CPU affinity to a single CPU.
thread_id current_thread_id() noexcept
Get the current thread id.
Definition thread.hpp:44
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11