[llvm] r284390 - Rename interface for querying physical hardware concurrency
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 17 07:56:53 PDT 2016
Author: tejohnson
Date: Mon Oct 17 09:56:53 2016
New Revision: 284390
URL: http://llvm.org/viewvc/llvm-project?rev=284390&view=rev
Log:
Rename interface for querying physical hardware concurrency
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.
Modified:
llvm/trunk/include/llvm/Support/Threading.h
llvm/trunk/lib/Support/Threading.cpp
llvm/trunk/unittests/Support/Threading.cpp
Modified: llvm/trunk/include/llvm/Support/Threading.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Threading.h?rev=284390&r1=284389&r2=284390&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Threading.h (original)
+++ llvm/trunk/include/llvm/Support/Threading.h Mon Oct 17 09:56:53 2016
@@ -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
Modified: llvm/trunk/lib/Support/Threading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Threading.cpp?rev=284390&r1=284389&r2=284390&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Threading.cpp (original)
+++ llvm/trunk/lib/Support/Threading.cpp Mon Oct 17 09:56:53 2016
@@ -118,7 +118,7 @@ void llvm::llvm_execute_on_thread(void (
#endif
-unsigned llvm::hardware_physical_concurrency() {
+unsigned llvm::heavyweight_hardware_concurrency() {
#if !LLVM_ENABLE_THREADS
return 1;
#endif
Modified: llvm/trunk/unittests/Support/Threading.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Threading.cpp?rev=284390&r1=284389&r2=284390&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/Threading.cpp (original)
+++ llvm/trunk/unittests/Support/Threading.cpp Mon Oct 17 09:56:53 2016
@@ -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());
More information about the llvm-commits
mailing list