Prevent panic in darwin AVX512 detection

This commit is contained in:
Luke Champine 2021-01-13 12:11:26 -05:00 committed by GitHub
parent 59a82aea36
commit d373079f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -17,6 +17,6 @@ func init() {
if !haveAVX512 {
// On some Macs, AVX512 detection is buggy, so fallback to sysctl
b, _ := syscall.Sysctl("hw.optional.avx512f")
haveAVX512 = b[0] == 1
haveAVX512 = len(b) > 0 && b[0] == 1
}
}