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
#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
#endif
-unsigned llvm::hardware_physical_concurrency() {
+unsigned llvm::heavyweight_hardware_concurrency() {
#if !LLVM_ENABLE_THREADS
return 1;
#endif
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());