gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

cpuid.go (391B)


      1 package base64x
      2 
      3 import (
      4     `fmt`
      5     `os`
      6 
      7     `github.com/klauspost/cpuid/v2`
      8 )
      9 
     10 func hasAVX2() bool {
     11     switch v := os.Getenv("B64X_MODE"); v {
     12         case ""       : fallthrough
     13         case "auto"   : return cpuid.CPU.Has(cpuid.AVX2)
     14         case "noavx2" : return false
     15         default       : panic(fmt.Sprintf("invalid mode: '%s', should be one of 'auto', 'noavx2'", v))
     16     }
     17 }