mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-11 13:46:13 +00:00
hardware_physical_concurrency() should return 1 when LLVM is built with LLVM_ENABLE_THREADS=OFF
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284283 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
31164bc2c9
commit
cb11533e7b
@ -118,6 +118,7 @@ namespace llvm {
|
||||
|
||||
/// Get the amount of currency 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();
|
||||
}
|
||||
|
||||
|
@ -119,6 +119,9 @@ void llvm::llvm_execute_on_thread(void (*Fn)(void*), void *UserData,
|
||||
#endif
|
||||
|
||||
unsigned llvm::hardware_physical_concurrency() {
|
||||
#if !LLVM_ENABLE_THREADS
|
||||
return 1;
|
||||
#endif
|
||||
int NumPhysical = sys::getHostNumPhysicalCores();
|
||||
if (NumPhysical == -1)
|
||||
return thread::hardware_concurrency();
|
||||
|
Loading…
Reference in New Issue
Block a user