Prevent panic in darwin AVX512 detection
This commit is contained in:
parent
59a82aea36
commit
d373079f35
|
@ -17,6 +17,6 @@ func init() {
|
||||||
if !haveAVX512 {
|
if !haveAVX512 {
|
||||||
// On some Macs, AVX512 detection is buggy, so fallback to sysctl
|
// On some Macs, AVX512 detection is buggy, so fallback to sysctl
|
||||||
b, _ := syscall.Sysctl("hw.optional.avx512f")
|
b, _ := syscall.Sysctl("hw.optional.avx512f")
|
||||||
haveAVX512 = b[0] == 1
|
haveAVX512 = len(b) > 0 && b[0] == 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue