Browse Source

initialize cpu thread affinity mask all to all cores (#5231)

call omp_set_num_threads with zero num_threads is implementation defined
tags/20240102
nihui GitHub 2 years ago
parent
commit
b7f70cfe4e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/cpu.cpp

+ 4
- 0
src/cpu.cpp View File

@@ -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


Loading…
Cancel
Save