diff --git a/cpu.go b/cpu.go index 76fee54..c2a61e7 100644 --- a/cpu.go +++ b/cpu.go @@ -2,9 +2,9 @@ package blake3 -import "github.com/klauspost/cpuid" +import "github.com/klauspost/cpuid/v2" var ( - haveAVX2 = cpuid.CPU.AVX2() - haveAVX512 = cpuid.CPU.AVX512F() + haveAVX2 = cpuid.CPU.Supports(cpuid.AVX2) + haveAVX512 = cpuid.CPU.Supports(cpuid.AVX512F) ) diff --git a/cpu_darwin.go b/cpu_darwin.go index 5af5635..372b734 100644 --- a/cpu_darwin.go +++ b/cpu_darwin.go @@ -3,7 +3,7 @@ package blake3 import ( "syscall" - "github.com/klauspost/cpuid" + "github.com/klauspost/cpuid/v2" ) var ( @@ -12,8 +12,8 @@ var ( ) func init() { - haveAVX2 = cpuid.CPU.AVX2() - haveAVX512 = cpuid.CPU.AVX512F() + haveAVX2 = cpuid.CPU.Supports(cpuid.AVX2) + haveAVX512 = cpuid.CPU.Supports(cpuid.AVX512F) if !haveAVX512 { // On some Macs, AVX512 detection is buggy, so fallback to sysctl b, _ := syscall.Sysctl("hw.optional.avx512f") diff --git a/go.mod b/go.mod index b793307..8f0680f 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,4 @@ module lukechampine.com/blake3 go 1.13 -require ( - github.com/klauspost/cpuid v1.3.1 -) +require github.com/klauspost/cpuid/v2 v2.0.9 diff --git a/go.sum b/go.sum index f568b65..a389a66 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= -github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=