[Bf-blender-cvs] [97c7c0abf50] blender2.7: Cleanup: add clarifying comments for recent NUMA fixes.

Brecht Van Lommel noreply at git.blender.org
Mon Jan 21 10:54:49 CET 2019


Commit: 97c7c0abf5083c621713474a760fc0f07f5c7da4
Author: Brecht Van Lommel
Date:   Mon Jan 21 10:51:19 2019 +0100
Branches: blender2.7
https://developer.blender.org/rB97c7c0abf5083c621713474a760fc0f07f5c7da4

Cleanup: add clarifying comments for recent NUMA fixes.

===================================================================

M	intern/cycles/util/util_task.cpp
M	intern/numaapi/source/numaapi_win32.c

===================================================================

diff --git a/intern/cycles/util/util_task.cpp b/intern/cycles/util/util_task.cpp
index 6260d8d13ab..2a705c2432b 100644
--- a/intern/cycles/util/util_task.cpp
+++ b/intern/cycles/util/util_task.cpp
@@ -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();
diff --git a/intern/numaapi/source/numaapi_win32.c b/intern/numaapi/source/numaapi_win32.c
index 8f1137a7bea..bd370707656 100644
--- a/intern/numaapi/source/numaapi_win32.c
+++ b/intern/numaapi/source/numaapi_win32.c
@@ -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);



More information about the Bf-blender-cvs mailing list