(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestExample(t *testing.T) { |
| 51 | Detect() |
| 52 | // Print basic CPU information: |
| 53 | fmt.Println("Name:", CPU.BrandName) |
| 54 | fmt.Println("PhysicalCores:", CPU.PhysicalCores) |
| 55 | fmt.Println("ThreadsPerCore:", CPU.ThreadsPerCore) |
| 56 | fmt.Println("LogicalCores:", CPU.LogicalCores) |
| 57 | fmt.Println("Family", CPU.Family, "Model:", CPU.Model, "Vendor ID:", CPU.VendorID) |
| 58 | fmt.Println("Features:", strings.Join(CPU.FeatureSet(), ",")) |
| 59 | fmt.Println("Cacheline bytes:", CPU.CacheLine) |
| 60 | fmt.Println("L1 Data Cache:", CPU.Cache.L1D, "bytes") |
| 61 | fmt.Println("L1 Instruction Cache:", CPU.Cache.L1D, "bytes") |
| 62 | fmt.Println("L2 Cache:", CPU.Cache.L2, "bytes") |
| 63 | fmt.Println("L3 Cache:", CPU.Cache.L3, "bytes") |
| 64 | fmt.Println("Frequency", CPU.Hz, "hz") |
| 65 | |
| 66 | // Test if we have these specific features: |
| 67 | if CPU.Supports(SSE, SSE2) { |
| 68 | fmt.Println("We have Streaming SIMD 2 Extensions") |
| 69 | } |
| 70 | } |
| 71 | func TestDumpCPUID(t *testing.T) { |
| 72 | n := int(maxFunctionID()) |
| 73 | for i := 0; i <= n; i++ { |
nothing calls this directly
no test coverage detected
searching dependent graphs…