Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support newer cpuid #12

Closed
jgoerzen opened this issue Sep 6, 2021 · 1 comment
Closed

Support newer cpuid #12

jgoerzen opened this issue Sep 6, 2021 · 1 comment

Comments

@jgoerzen
Copy link

jgoerzen commented Sep 6, 2021

Hi,

While packaging this for Debian, we have cpuid v2 in the repository and I needed to get it to compile with that version.

The patch for compatibility with cpuid v2 is simple:

--- a/cpu.go
+++ b/cpu.go
@@ -5,6 +5,6 @@
 import "github.com/klauspost/cpuid"
 
 var (
-	haveAVX2   = cpuid.CPU.AVX2()
-	haveAVX512 = cpuid.CPU.AVX512F()
+	haveAVX2   = cpuid.CPU.Supports(cpuid.AVX2)
+	haveAVX512 = cpuid.CPU.Supports(cpuid.AVX512F)
 )

Thanks!

Stebalien added a commit to Stebalien/blake3 that referenced this issue Sep 6, 2021
@lukechampine
Copy link
Owner

fixed in 09d3897

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants