15 #include <vsg/core/Export.h>
28 explicit Affinity(uint32_t cpu, uint32_t num = 1)
30 for (uint32_t i = 0; i < num; ++i) cpus.insert(cpu + i);
33 std::set<uint32_t> cpus;
35 operator bool()
const {
return !cpus.empty(); }
39 extern VSG_DECLSPEC
void setAffinity(std::thread& thread,
const Affinity& affinity);
43 extern VSG_DECLSPEC
void setAffinity(
const Affinity& affinity);
Affinity struct provides a set of cpu ids that a thread can be set to have affinity to.
Definition: Affinity.h:25