mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
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. llvm-svn: 284390
This commit is contained in:
parent
cd256ad4ac
commit
61cd8d0bb8
@ -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
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user