Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/klauspost/cpuid
/ functions
Functions
132 in github.com/klauspost/cpuid
⨍
Functions
132
◇
Types & classes
13
↓ 366 callers
Method
setIf
setIf will set a feature if boolean is true.
cpuid.go:889
↓ 40 callers
Function
setFeature
(c *CPUInfo, feature FeatureID, aliases ...string)
os_darwin_arm64.go:68
↓ 39 callers
Function
isSet
(hwc uint, value uint)
os_linux_arm64.go:222
↓ 32 callers
Function
CombineFeatures
CombineFeatures allows to combine several features for a close to constant time lookup.
cpuid.go:556
↓ 29 callers
Method
set
(feat FeatureID)
cpuid.go:884
↓ 27 callers
Method
inSet
(feat FeatureID)
cpuid.go:880
↓ 21 callers
Function
maxExtendedFunction
()
cpuid.go:981
↓ 19 callers
Method
hasSetP
hasSet returns whether all features are present.
cpuid.go:920
↓ 17 callers
Function
addFeats
addFeats returns a fresh slice of base plus add, avoiding append aliasing.
cpuid_test.go:392
↓ 13 callers
Function
maxFunctionID
()
cpuid.go:986
↓ 10 callers
Method
Has
Has allows for checking a single feature. Should be inlined by the compiler.
cpuid.go:542
↓ 9 callers
Method
String
()
mockcpu_test.go:22
↓ 8 callers
Method
FeatureSet
FeatureSet returns all available features as strings.
cpuid.go:736
↓ 7 callers
Function
Detect
Detect will re-detect current CPU info. This will replace the content of the exported CPU variable. Unless you expect the CPU to change while you are
cpuid.go:478
↓ 7 callers
Method
Supports
Supports returns whether the CPU supports all of the requested features.
cpuid.go:531
↓ 6 callers
Method
X64Level
X64Level returns the microarchitecture level detected on the CPU. If features are lacking or non x64 mode, 0 is returned. See https://en.wikipedia.org
cpuid.go:633
↓ 6 callers
Function
sysctlGetInt
(unknown int, names ...string)
os_darwin_arm64.go:42
↓ 6 callers
Function
vendorID
()
cpuid.go:1157
↓ 5 callers
Method
Strings
Strings returns an array of the detected features for FlagsSet.
cpuid.go:968
↓ 5 callers
Function
sysctlGetInt64
(unknown int, names ...string)
os_darwin_arm64.go:55
↓ 5 callers
Function
threadsPerCore
()
cpuid.go:1003
↓ 4 callers
Method
HasOneOf
HasOneOf returns whether the CPU supports one or more of the requested features.
cpuid.go:569
↓ 4 callers
Function
valAsString
(values ...uint32)
cpuid.go:1802
↓ 3 callers
Method
GOARM64
GOARM64 returns a value usable as the GOARM64 build setting for the detected CPU, e.g. "v8.4" or "v9.0,crypto". The ",crypto" suffix is appended when
cpuid.go:698
↓ 3 callers
Method
HasAll
(f Features)
cpuid.go:564
↓ 3 callers
Function
detectOS
(c *CPUInfo)
os_other_arm64.go:9
↓ 3 callers
Function
familyModel
()
cpuid.go:1078
↓ 3 callers
Function
logicalCores
()
cpuid.go:1051
↓ 3 callers
Method
nEnabled
nEnabled will return the number of enabled flags.
cpuid.go:940
↓ 2 callers
Method
ARM64Level
ARM64Level returns the ARMv8/ARMv9 architecture version supported by the CPU as (major, minor), e.g. 8, 4 for ARMv8.4-A or 9, 0 for ARMv9.0-A. Only ma
cpuid.go:674
↓ 2 callers
Method
Ia32TscAux
Ia32TscAux returns the IA32_TSC_AUX part of the RDTSCP. This variable is OS dependent, but on Linux contains information about the current cpu/core th
cpuid.go:757
↓ 2 callers
Function
ParseFeature
ParseFeature will parse the string and return the ID of the matching feature. Will return UNKNOWN if not found.
cpuid.go:957
↓ 2 callers
Method
RTCounter
RTCounter returns the 64-bit time-stamp counter Uses the RDTSCP instruction. The value 0 is returned if the CPU does not support the instruction.
cpuid.go:745
↓ 2 callers
Method
RVProfile
RVProfile returns the RISC-V application profile level. 0 = unknown / base ISA only, 20 = RVA20, 22 = RVA22, 23 = RVA23. Returns 0 on non-RISC-V archi
cpuid.go:656
↓ 2 callers
Method
VM
VM Will return true if the cpu id indicates we are in a virtual machine.
cpuid.go:865
↓ 2 callers
Function
addInfo
(info *CPUInfo, safe bool)
detect_ref.go:15
↓ 2 callers
Function
armCPU
(ids ...FeatureID)
cpuid_test.go:383
↓ 2 callers
Method
hasOneOf
hasOneOf returns whether one or more features are present.
cpuid.go:930
↓ 2 callers
Function
parseISAString
(c *CPUInfo, isa string)
riscv_isa.go:7
↓ 2 callers
Function
parseLeaf0AH
(c *CPUInfo, eax, ebx, edx uint32)
cpuid.go:1824
↓ 2 callers
Function
riscvVendorID
(mvendorid uint64)
riscv_isa.go:88
↓ 2 callers
Method
unset
(offset FeatureID)
cpuid.go:897
↓ 1 callers
Method
Disable
Disable will disable one or several features.
cpuid.go:714
↓ 1 callers
Method
Enable
Enable will disable one or several features even if they were undetected. This is of course not recommended for obvious reasons.
cpuid.go:723
↓ 1 callers
Method
LogicalCPU
LogicalCPU will return the Logical CPU the code is currently executing on. This is likely to change when the OS re-schedules the running thread to ano
cpuid.go:778
↓ 1 callers
Function
ParseURL
(s string, gw *zip.Writer)
testdata/getall.go:61
↓ 1 callers
Function
brandName
()
cpuid.go:991
↓ 1 callers
Function
cacheLine
()
cpuid.go:1178
↓ 1 callers
Method
cacheSize
()
cpuid.go:1193
↓ 1 callers
Function
detectCacheLine
()
os_linux_riscv64.go:216
↓ 1 callers
Function
detectFromCPUInfo
(c *CPUInfo)
os_linux_riscv64.go:184
↓ 1 callers
Function
detectFromHWProbe
(c *CPUInfo, pairs []riscvHWProbePair)
os_linux_riscv64.go:113
↓ 1 callers
Method
frequencies
frequencies tries to compute the clock speed of the CPU. If leaf 15 is supported, use it, otherwise parse the brand string. Yes, really.
cpuid.go:788
↓ 1 callers
Function
getInstAttributes
()
detect_arm64.go:11
↓ 1 callers
Function
getMidr
()
detect_arm64.go:9
↓ 1 callers
Function
getProcFeatures
()
detect_arm64.go:10
↓ 1 callers
Function
getVectorLength
()
detect_ref.go:16
↓ 1 callers
Function
hasAMDMemEncryption
(available bool)
cpuid.go:1374
↓ 1 callers
Function
hasSGX
(available, lc bool)
cpuid.go:1329
↓ 1 callers
Method
hasSet
hasSet returns whether all features are present.
cpuid.go:910
↓ 1 callers
Function
hypervisorVendorID
()
cpuid.go:1167
↓ 1 callers
Function
initCPU
()
detect_ref.go:7
↓ 1 callers
Function
mockCPU
(def []byte)
mockcpu_test.go:34
↓ 1 callers
Method
or
or with another flagset.
cpuid.go:903
↓ 1 callers
Function
physicalCores
()
cpuid.go:1101
↓ 1 callers
Function
riscvHWProbe
(pairs []riscvHWProbePair)
os_linux_riscv64.go:77
↓ 1 callers
Function
support
()
cpuid.go:1391
↓ 1 callers
Method
supportAVX10
()
cpuid.go:1794
↓ 1 callers
Function
sysctlGetBool
(name string)
os_darwin_arm64.go:26
↓ 1 callers
Function
sysctlGetString
(name string)
os_darwin_arm64.go:34
↓ 1 callers
Function
tryToFillCPUInfoFomSysctl
(c *CPUInfo)
os_darwin_arm64.go:78
Method
AnyOf
AnyOf returns whether the CPU supports one or more of the requested features.
cpuid.go:547
Function
BenchmarkFlags
(b *testing.B)
cpuid_test.go:333
Function
DetectARM
DetectARM will detect ARM64 features. This is NOT done automatically since it can potentially crash if the OS does not handle the command. If in the f
cpuid.go:511
Function
Example
()
cpuid_test.go:94
Function
ExampleCPUInfo_Ia32TscAux
This example will calculate the chip/core number on Linux Linux encodes numa id (<<12) and core id (8bit) into TSC_AUX.
cpuid_test.go:247
Function
Flags
Flags will enable flags. This must be called *before* flag.Parse AND Detect must be called after the flags have been parsed. Note that this means that
cpuid.go:524
Method
IsVendor
IsVendor returns true if vendor is recognized as Intel
cpuid.go:731
Method
String
()
featureid_string.go:312
Method
String
()
featureid_string.go:366
Method
SveLengths
SveLengths returns arm SVE vector and predicate lengths in bits. Will return 0, 0 if SVE is not enabled or otherwise unable to detect.
cpuid.go:767
Function
TestAMDMemEncryption
TestAMDMemEncryption tests AMDMemEncryption detection
cpuid_test.go:141
Function
TestARM64Level
(t *testing.T)
cpuid_test.go:398
Function
TestBrandNameZero
(t *testing.T)
cpuid_test.go:105
Function
TestCPUID
There is no real way to test a CPU identifier, since results will obviously differ on each machine.
cpuid_test.go:26
Function
TestCombineFeatures
(t *testing.T)
cpuid_test.go:258
Function
TestDarwinL1DCache
Tests that the returned L1 data cache value matches the value returned from a call to the OS `sysctl` utility. Skips the test if we can't run it.
os_darwin_test.go:30
Function
TestDarwinL1ICache
Tests that the returned L1 instruction cache value matches the value returned from a call to the OS `sysctl` utility. Skips the test if we can't run i
os_darwin_test.go:12
Function
TestDumpCPUID
(t *testing.T)
cpuid_test.go:71
Function
TestExample
(t *testing.T)
cpuid_test.go:50
Function
TestGOARM64
(t *testing.T)
cpuid_test.go:435
Function
TestHas
(t *testing.T)
cpuid_test.go:150
Function
TestHasOneOf
(t *testing.T)
cpuid_test.go:364
Function
TestIa32TscAux
Prints the value of Ia32TscAux()
cpuid_test.go:213
Function
TestLastID
(t *testing.T)
cpuid_test.go:12
Function
TestLastVendorID
(t *testing.T)
cpuid_test.go:18
Function
TestLogicalCPU
Prints the value of LogicalCPU()
cpuid_test.go:230
Function
TestMaxFunction
(t *testing.T)
cpuid_test.go:234
Function
TestMocks
(t *testing.T)
mockcpu_test.go:160
Function
TestParseISAString
(t *testing.T)
cpuid_test.go:462
next →
1–100 of 132, ranked by callers