forked from bartvdbraak/blender
Cleanup: add clarifying comments for recent NUMA fixes.
This commit is contained in:
parent
08871b56bc
commit
97c7c0abf5
@ -223,10 +223,10 @@ int get_num_total_processors(const vector<int>& num_per_node_processors)
|
||||
return num_total_processors;
|
||||
}
|
||||
|
||||
/* Assign every thread a node on which is should be running, for the best
|
||||
* performance. */
|
||||
/* Compute NUMA node for every thread to run on, for the best performance. */
|
||||
vector<int> distribute_threads_on_nodes(const int num_threads)
|
||||
{
|
||||
/* Start with all threads unassigned to any specific NUMA node. */
|
||||
vector<int> thread_nodes(num_threads, -1);
|
||||
const int num_active_group_processors =
|
||||
system_cpu_num_active_group_processors();
|
||||
|
@ -165,6 +165,7 @@ NUMAAPI_Result numaAPI_Initialize(void) {
|
||||
|
||||
static int countNumSetBits(ULONGLONG mask) {
|
||||
// TODO(sergey): There might be faster way calculating number of set bits.
|
||||
// NOTE: mask must be unsigned, there is undefined behavior for signed ints.
|
||||
int num_bits = 0;
|
||||
while (mask != 0) {
|
||||
num_bits += (mask & 1);
|
||||
|
Loading…
Reference in New Issue
Block a user