File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 7
7
8
8
static int check_cpu_feature_support (std::string_view cpufeature)
9
9
{
10
- if (cpufeature == " avx512_spr" )
10
+ const char * disable_avx512 = std::getenv (" XSS_DISABLE_AVX512" );
11
+
12
+ if ((cpufeature == " avx512_spr" ) && (!disable_avx512))
11
13
#ifdef __FLT16_MAX__
12
14
return __builtin_cpu_supports (" avx512f" )
13
15
&& __builtin_cpu_supports (" avx512fp16" )
14
16
&& __builtin_cpu_supports (" avx512vbmi2" );
15
17
#else
16
18
return 0 ;
17
19
#endif
18
- else if (cpufeature == " avx512_icl" )
20
+ else if (( cpufeature == " avx512_icl" ) && (!disable_avx512) )
19
21
return __builtin_cpu_supports (" avx512f" )
20
22
&& __builtin_cpu_supports (" avx512vbmi2" )
21
23
&& __builtin_cpu_supports (" avx512bw" )
22
24
&& __builtin_cpu_supports (" avx512vl" );
23
- else if (cpufeature == " avx512_skx" )
25
+ else if (( cpufeature == " avx512_skx" ) && (!disable_avx512) )
24
26
return __builtin_cpu_supports (" avx512f" )
25
27
&& __builtin_cpu_supports (" avx512dq" )
26
28
&& __builtin_cpu_supports (" avx512vl" );
You can’t perform that action at this time.
0 commit comments