| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package main |
| 6 |
|
| 7 |
import ( |
| 8 |
"fmt" |
| 9 |
"github.com/intel-go/cpuid" |
| 10 |
) |
| 11 |
|
| 12 |
func main() { |
| 13 |
fmt.Printf("VendorString: %s\n", cpuid.VendorIdentificatorString) |
| 14 |
fmt.Printf("ProcessorBrandString: %s\n", cpuid.ProcessorBrandString) |
| 15 |
fmt.Printf("SteppingId: %d\n", cpuid.SteppingId) |
| 16 |
fmt.Printf("ProcessorType: %d\n", cpuid.ProcessorType) |
| 17 |
fmt.Printf("DisplayFamily: %d\n", cpuid.DisplayFamily) |
| 18 |
fmt.Printf("DisplayModel: %d\n", cpuid.DisplayModel) |
| 19 |
fmt.Printf("CacheLineSize: %d\n", cpuid.CacheLineSize) |
| 20 |
fmt.Printf("MaxLogicalCPUId:%d\n", cpuid.MaxLogicalCPUId) |
| 21 |
fmt.Printf("InitialAPICId: %d\n", cpuid.InitialAPICId) |
| 22 |
fmt.Printf("Smallest monitor-line size in bytes: %d\n", cpuid.MonLineSizeMin) |
| 23 |
fmt.Printf("Largest monitor-line size in bytes: %d\n", cpuid.MonLineSizeMax) |
| 24 |
fmt.Printf("Monitor Interrupt break-event is supported: %v\n", cpuid.MonitorIBE) |
| 25 |
fmt.Printf("MONITOR/MWAIT extensions are supported: %v\n", cpuid.MonitorEMX) |
| 26 |
fmt.Printf("AVX state: %v\n", cpuid.EnabledAVX) |
| 27 |
fmt.Printf("AVX-512 state: %v\n", cpuid.EnabledAVX512) |
| 28 |
fmt.Printf("Interrupt thresholds in digital thermal sensor: %v\n", cpuid.ThermalSensorInterruptThresholds) |
| 29 |
|
| 30 |
fmt.Printf("Features: ") |
| 31 |
for i := uint64(0); i < 64; i++ { |
| 32 |
if cpuid.HasFeature(1 << i) { |
| 33 |
fmt.Printf("%s ", cpuid.FeatureNames[1<<i]) |
| 34 |
} |
| 35 |
} |
| 36 |
fmt.Printf("\n") |
| 37 |
|
| 38 |
fmt.Printf("ExtendedFeatures: ") |
| 39 |
for i := uint64(0); i < 64; i++ { |
| 40 |
if cpuid.HasExtendedFeature(1 << i) { |
| 41 |
fmt.Printf("%s ", cpuid.ExtendedFeatureNames[1<<i]) |
| 42 |
} |
| 43 |
} |
| 44 |
fmt.Printf("\n") |
| 45 |
|
| 46 |
fmt.Printf("ExtraFeatures: ") |
| 47 |
for i := uint64(0); i < 64; i++ { |
| 48 |
if cpuid.HasExtraFeature(1 << i) { |
| 49 |
fmt.Printf("%s ", cpuid.ExtraFeatureNames[1<<i]) |
| 50 |
} |
| 51 |
} |
| 52 |
fmt.Printf("\n") |
| 53 |
|
| 54 |
fmt.Printf("ThermalAndPowerFeatures: ") |
| 55 |
for i := uint32(0); i < 64; i++ { |
| 56 |
if cpuid.HasThermalAndPowerFeature(1 << i) { |
| 57 |
if name, found := cpuid.ThermalAndPowerFeatureNames[1<<i]; found { |
| 58 |
fmt.Printf("%s ", name) |
| 59 |
} |
| 60 |
} |
| 61 |
} |
| 62 |
fmt.Printf("\n") |
| 63 |
|
| 64 |
for _, cacheDescription := range cpuid.CacheDescriptors { |
| 65 |
fmt.Printf("CacheDescriptor: %v\n", cacheDescription) |
| 66 |
} |
| 67 |
|
| 68 |
} |