Skip to content

Commit

Permalink
detect more baseline avx512 flags (#3687)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui authored Apr 9, 2022
1 parent a062148 commit 32560f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ static int get_cpu_support_x86_avx512()
return 0;

x86_cpuid_sublevel(7, 0, cpu_info);
return (cpu_info[1] & (1u << 16)) && (cpu_info[1] & (1u << 31));
return (cpu_info[1] & (1u << 16)) && (cpu_info[1] & (1u << 17)) && (cpu_info[1] & (1u << 28)) && (cpu_info[1] & (1u << 30)) && (cpu_info[1] & (1u << 31));
}

static int get_cpu_support_x86_avx512_vnni()
Expand Down
2 changes: 1 addition & 1 deletion src/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ NCNN_EXPORT int cpu_support_x86_f16c();
NCNN_EXPORT int cpu_support_x86_avx2();
// avx_vnni = x86 avx vnni
NCNN_EXPORT int cpu_support_x86_avx_vnni();
// avx512 = x86 avx512f + avx512vl
// avx512 = x86 avx512f + avx512cd + avx512bw + avx512dq + avx512vl
NCNN_EXPORT int cpu_support_x86_avx512();
// avx512_vnni = x86 avx512 vnni
NCNN_EXPORT int cpu_support_x86_avx512_vnni();
Expand Down

0 comments on commit 32560f4

Please sign in to comment.