Setup a fake NUMA setup where CpuInfo will report a NUMA configuration other than the system's actual configuration. If 'has_numa' is true, sets it up as three NUMA nodes with the cores distributed between them. Otherwise sets it up as a single NUMA node.
| 65 | /// nodes with the cores distributed between them. Otherwise sets it up as a single |
| 66 | /// NUMA node. |
| 67 | static void SetupFakeNuma(bool has_numa) { |
| 68 | std::vector<int> core_to_node(CpuInfo::GetMaxNumCores()); |
| 69 | int num_nodes = has_numa ? 3 : 1; |
| 70 | for (int i = 0; i < core_to_node.size(); ++i) core_to_node[i] = i % num_nodes; |
| 71 | CpuInfo::InitFakeNumaForTest(num_nodes, core_to_node); |
| 72 | LOG(INFO) << CpuInfo::DebugString(); |
| 73 | } |
| 74 | |
| 75 | /// Set CpuInfo::max_num_cores_ to 'max_num_cores'. The caller is responsible for |
| 76 | /// resetting it to its original value. |
nothing calls this directly
no test coverage detected