Sha256: 289da93be4624cb43edccb6126032f3dce2870f3bb8712c6aaba20515d08d48d

Contents?: true

Size: 820 Bytes

Versions: 16

Compression:

Stored size: 820 Bytes

Contents

// Package cpuinfo gives runtime info about the current CPU.
//
// This is a very limited module meant for use internally
// in this project. For more versatile solution check
// https://github.com/klauspost/cpuid.
package cpuinfo

// HasBMI1 checks whether an x86 CPU supports the BMI1 extension.
func HasBMI1() bool {
	return hasBMI1
}

// HasBMI2 checks whether an x86 CPU supports the BMI2 extension.
func HasBMI2() bool {
	return hasBMI2
}

// DisableBMI2 will disable BMI2, for testing purposes.
// Call returned function to restore previous state.
func DisableBMI2() func() {
	old := hasBMI2
	hasBMI2 = false
	return func() {
		hasBMI2 = old
	}
}

// HasBMI checks whether an x86 CPU supports both BMI1 and BMI2 extensions.
func HasBMI() bool {
	return HasBMI1() && HasBMI2()
}

var hasBMI1 bool
var hasBMI2 bool

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_snowflake_client-1.3.7 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.3.6 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.3.5 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.3.4 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.3.4.pre.debug ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.3.3.pre.debug ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.3.2 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.3.1 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.3.0 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.2.1 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.2.0 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.1.1 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.1.0 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.0.2 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.0.1 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go
ruby_snowflake_client-1.0.0 ext/vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go