1 2 // Copyright Oliver Kowalke 2017. 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt) 6 7 #ifndef BOOST_FIBERS_NUMA_TOPOLOGY_H 8 #define BOOST_FIBERS_NUMA_TOPOLOGY_H 9 10 #include <cstdint> 11 #include <set> 12 #include <vector> 13 14 #include <boost/config.hpp> 15 16 #include <boost/fiber/detail/config.hpp> 17 18 #ifdef BOOST_HAS_ABI_HEADERS 19 # include BOOST_ABI_PREFIX 20 #endif 21 22 namespace boost { 23 namespace fibers { 24 namespace numa { 25 26 struct node { 27 std::uint32_t id; 28 std::set< std::uint32_t > logical_cpus; 29 std::vector< std::uint32_t > distance; 30 }; 31 32 inline operator <(node const & lhs,node const & rhs)33bool operator<( node const& lhs, node const& rhs) noexcept { 34 return lhs.id < rhs.id; 35 } 36 37 BOOST_FIBERS_DECL 38 std::vector< node > topology(); 39 40 }}} 41 42 #ifdef BOOST_HAS_ABI_HEADERS 43 # include BOOST_ABI_SUFFIX 44 #endif 45 46 #endif // BOOST_FIBERS_NUMA_TOPOLOGY_H 47