23 #if _MSC_VER && !__INTEL_COMPILER
24 #pragma warning( push )
25 #pragma warning( disable : 4100 )
28 #if _MSC_VER && !__INTEL_COMPILER
29 #pragma warning( pop )
36 #define assertion_hwloc_wrapper(command, ...) \
37 __TBB_ASSERT_EX( (command(__VA_ARGS__)) >= 0, "Error occurred during call to hwloc API.");
78 if ( hwloc_topology_init( &
topology ) == 0 ) {
80 if ( hwloc_topology_load(
topology ) == 0 ) {
126 unsigned counter = 0;
128 int max_numa_index = -1;
130 hwloc_obj_t node_buffer;
132 node_buffer = hwloc_get_obj_by_type(
topology, HWLOC_OBJ_NUMANODE, i);
140 } hwloc_bitmap_foreach_end();
141 __TBB_ASSERT(max_numa_index >= 0,
"Maximal NUMA index must not be negative");
149 node_buffer = hwloc_get_obj_by_type(
topology, HWLOC_OBJ_NUMANODE, i);
150 index = static_cast<int>(node_buffer->logical_index);
153 current_mask = hwloc_bitmap_dup(node_buffer->cpuset);
156 __TBB_ASSERT(!hwloc_bitmap_iszero(current_mask),
"hwloc detected unavailable NUMA node");
158 } hwloc_bitmap_foreach_end();
178 static void fill(
int& nodes_count,
int*& indexes_list,
int*& concurrency_list ) {
191 hwloc_bitmap_free(mask_to_free);
199 "Current affinity mask must intersects with process affinity mask");
208 "Trying to get affinity mask for uninitialized NUMA node");
247 "The slot number is greater than the number of slots in the arena");
249 "Trying to get access to uninitialized platform_topology");
258 "Trying to get access to uninitialized platform_topology");
286 int& nodes_count,
int*& indexes_list,
int*& concurrency_list ) {
293 __TBB_ASSERT(binding_observer,
"Failure during NUMA binding observer allocation and construction");
294 binding_observer->
observe(
true);
295 return binding_observer;
299 __TBB_ASSERT(binding_observer,
"Trying to deallocate NULL pointer");
300 binding_observer->
observe(
false);
301 delete binding_observer;
309 #undef assertion_hwloc_wrapper