Skip to content

Commit

Permalink
Slightly simplify hardware_concurrency implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
msimberg committed Aug 15, 2023
1 parent 2324749 commit 7426fad
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions libs/pika/topology/src/topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
#endif

namespace pika::threads::detail {
std::size_t hwloc_hardware_concurrency()
{
threads::detail::topology& top = threads::detail::get_topology();
return top.get_number_of_pus();
}

void write_to_log(char const* valuename, std::size_t value)
{
LTM_(debug).format("topology: {}: {}", valuename, value); //-V128
Expand Down Expand Up @@ -1455,7 +1449,7 @@ namespace pika::threads::detail {
#if defined(__ANDROID__) && defined(ANDROID)
: num_of_cores_(::android_getCpuCount())
#else
: num_of_cores_(hwloc_hardware_concurrency())
: num_of_cores_(get_topology().get_number_of_pus())
#endif
{
if (num_of_cores_ == 0) num_of_cores_ = 1;
Expand Down

0 comments on commit 7426fad

Please sign in to comment.