Skip to content

Commit

Permalink
initialize cpu thread affinity mask all to all cores (#5231)
Browse files Browse the repository at this point in the history
call omp_set_num_threads with zero num_threads is implementation defined
  • Loading branch information
nihui authored Dec 19, 2023
1 parent 5750986 commit b7f70cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,10 @@ static int set_sched_affinity(const ncnn::CpuSet& thread_affinity_mask)
static void initialize_cpu_thread_affinity_mask(ncnn::CpuSet& mask_all, ncnn::CpuSet& mask_little, ncnn::CpuSet& mask_big)
{
mask_all.disable_all();
for (int i = 0; i < g_cpucount; i++)
{
mask_all.enable(i);
}

#if (defined _WIN32 && !(defined __MINGW32__))
// get max freq mhz for all cores
Expand Down

0 comments on commit b7f70cf

Please sign in to comment.