Rename interface for querying physical hardware concurrency
authorTeresa Johnson <tejohnson@google.com>
Mon, 17 Oct 2016 14:56:53 +0000 (14:56 +0000)
committerTeresa Johnson <tejohnson@google.com>
Mon, 17 Oct 2016 14:56:53 +0000 (14:56 +0000)
Based on post-commit review for D25585/r284180, rename
hardware_physical_concurrency to heavyweight_hardware_concurrency,
to better reflect what type of tasks it should be used for and
to enable other systems to map this to something other than the
number of physical cores.

llvm-svn: 284390

llvm/include/llvm/Support/Threading.h
llvm/lib/Support/Threading.cpp
llvm/unittests/Support/Threading.cpp

index 8c9c0da..0e9b88e 100644 (file)
@@ -116,10 +116,12 @@ namespace llvm {
 #endif
   }
 
-  /// Get the amount of currency based on physical cores, if available for the
-  /// host system, otherwise falls back to thread::hardware_concurrency().
+  /// Get the amount of currency to use for tasks requiring significant
+  /// memory or other resources. Currently based on physical cores, if
+  /// available for the host system, otherwise falls back to
+  /// thread::hardware_concurrency().
   /// Returns 1 when LLVM is configured with LLVM_ENABLE_THREADS=OFF
-  unsigned hardware_physical_concurrency();
+  unsigned heavyweight_hardware_concurrency();
 }
 
 #endif
index fd303af..760f9e2 100644 (file)
@@ -118,7 +118,7 @@ void llvm::llvm_execute_on_thread(void (*Fn)(void*), void *UserData,
 
 #endif
 
-unsigned llvm::hardware_physical_concurrency() {
+unsigned llvm::heavyweight_hardware_concurrency() {
 #if !LLVM_ENABLE_THREADS
   return 1;
 #endif
index 30a3c74..be53026 100644 (file)
@@ -16,7 +16,7 @@ using namespace llvm;
 namespace {
 
 TEST(Threading, PhysicalConcurrency) {
-  auto Num = hardware_physical_concurrency();
+  auto Num = heavyweight_hardware_concurrency();
   // Since Num is unsigned this will also catch us trying to
   // return -1.
   ASSERT_LE(Num, thread::hardware_concurrency());