cpuid

package
v0.0.0-...-85e8820 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2024 License: MIT, BSD-3-Clause, Apache-2.0 Imports: 0 Imported by: 0

README

cpuid

Intel CPUID library for Go Programming Language

The cpuid package provides convenient and fast access to information from the x86 CPUID instruction. The package gathers all information during package initialization phase so its public interface will not need to execute the CPUID instruction at runtime. Frequent calls to the CPUID instruction can hurt performance, so this package makes it easier to do CPU-specific optimizations.

GoDoc

You can get it with
go get github.com/intel-go/cpuid
Example:
package main

import (
    "github.com/intel-go/cpuid"
    "fmt"
)

func main() {
    fmt.Printf("VendorString:   %s\n", cpuid.VendorIdentificatorString)

    fmt.Printf("Features: ")
    for i := uint64(0); i < 64; i++ {
        if cpuid.HasFeature(1 << i) {
            fmt.Printf("%s ", cpuid.FeatureNames[1<<i])
        }
    }
    fmt.Printf("\n")

    fmt.Printf("ExtendedFeatures: ")
    for i := uint64(0); i < 64; i++ {
        if cpuid.HasExtendedFeature(1 << i) {
            fmt.Printf("%s ", cpuid.ExtendedFeatureNames[1<<i])
        }
    }
    fmt.Printf("\n")

    fmt.Printf("ExtraFeatures: ")
    for i := uint64(0); i < 64; i++ {
        if cpuid.HasExtraFeature(1 << i) {
            fmt.Printf("%s ", cpuid.ExtraFeatureNames[1<<i])
        }
    }
    fmt.Printf("\n")
}
API description

Most data is available with simple variables:

  • SteppingId uint32 Processor Stepping ID
  • ProcessorType uint32 Processor type
  • DisplayFamily uint32 Processor family
  • DisplayModel uint32 Processor model
  • CacheLineSize uint32 Cache line size in bytes
  • MaxLogocalCPUId uint32 Maximum number of addressable IDs for logical processors in this physical package
  • InitialAPICId uint32 Initial APIC ID
  • CacheDescriptors []CacheDescriptor Cache descriptor's array

You can iterate over them as follows:

for _, cacheDescription := range cpuid.CacheDescriptors {
    fmt.Printf("CacheDescriptor: %v\n", cacheDescription)
}
  • MonLineSizeMin uint32 Smallest monitor-line size in bytes (default is processor's monitor granularity)

  • MonLineSizeMax uint32 Largest monitor-line size in bytes (default is processor's monitor granularity)

  • MonitorEMX bool Enumeration of Monitor-Mwait extensions availability status

  • MonitorIBE bool Supports treating interrupts as break-event for MWAIT flag

  • EnabledAVX bool EnabledAVX flag allows to check if feature AVX is enabled by OS/BIOS

  • EnabledAVX512 bool EnabledAVX512 flag allows to check if features AVX512xxx are enabled by OS/BIOS

  • func HasFeature(feature uint64) bool to check for the following features:

    SSE3 Prescott New Instructions-SSE3 (PNI)
    PCLMULQDQ PCLMULQDQ support
    DTES64 64-bit debug store (edx bit 21)
    MONITOR MONITOR and MWAIT instructions (SSE3)
    DSI_CPL CPL qualified debug store
    VMX Virtual Machine eXtensions
    SMX Safer Mode Extensions (LaGrande)
    EST Enhanced SpeedStep
    TM2 Thermal Monitor 2
    SSSE3 Supplemental SSE3 instructions
    CNXT_ID L1 Context ID
    SDBG Silicon Debug interface
    FMA Fused multiply-add (FMA3)
    CX16 CMPXCHG16B instruction
    XTPR Can disable sending task priority messages
    PDCM Perfmon & debug capability
    PCID Process context identifiers (CR4 bit 17)
    DCA Direct cache access for DMA writes[10][11]
    SSE4_1 SSE4.1 instructions
    SSE4_2 SSE4.2 instructions
    X2APIC x2APIC support
    MOVBE MOVBE instruction (big-endian)
    POPCNT POPCNT instruction
    TSC_DEADLINE line APIC supports one-shot operation using a TSC deadline value
    AES AES instruction set
    XSAVE XSAVE, XRESTOR, XSETBV, XGETBV
    OSXSAVE XSAVE enabled by OS
    AVX Advanced Vector Extensions
    F16C F16C (half-precision) FP support
    RDRND RDRAND (on-chip random number generator) support
    HYPERVISOR Running on a hypervisor (always 0 on a real CPU, but also with some hypervisors)
    FPU Onboard x87 FPU
    VME Virtual 8086 mode extensions (such as VIF, VIP, PIV)
    DE Debugging extensions (CR4 bit 3)
    PSE Page Size Extension
    TSC Time Stamp Counter
    MSR Model-specific registers
    PAE Physical Address Extension
    MCE Machine Check Exception
    CX8 CMPXCHG8 (compare-and-swap) instruction
    APIC Onboard Advanced Programmable Interrupt Controller
    SEP SYSENTER and SYSEXIT instructions
    MTRR Memory Type Range Registers
    PGE Page Global Enable bit in CR4
    MCA Machine check architecture
    CMOV Conditional move and FCMOV instructions
    PAT Page Attribute Table
    PSE_36 36-bit page size extension
    PSN Processor Serial Number
    CLFSH CLFLUSH instruction (SSE2)
    DS Debug store: save trace of executed jumps
    ACPI Onboard thermal control MSRs for ACPI
    MMX MMX instructions
    FXSR FXSAVE, FXRESTOR instructions, CR4 bit 9
    SSE SSE instructions (a.k.a. Katmai New Instructions)
    SSE2 SSE2 instructions
    SS CPU cache supports self-snoop
    HTT Hyper-threading
    TM Thermal monitor automatically limits temperature
    IA64 IA64 processor emulating x86
    PBE Pending Break Enable (PBE# pin) wakeup support

Usage example:

if EnabledAVX && HasFeature(AVX) {
    fmt.Printf("We can use AVX\n")
}
  • func HasExtendedFeature(feature uint64) bool to check for the following features:

    FSGSBASE Access to base of %fs and %gs
    IA32_TSC_ADJUST IA32_TSC_ADJUST MSR is supported if 1
    BMI1 Bit Manipulation Instruction Set 1
    HLE Transactional Synchronization Extensions
    AVX2 Advanced Vector Extensions 2
    SMEP Supervisor-Mode Execution Prevention
    BMI2 Bit Manipulation Instruction Set 2
    ERMS Enhanced REP MOVSB/STOSB
    INVPCID INVPCID instruction
    RTM Transactional Synchronization Extensions
    PQM Supports Platform Quality of Service Monitoring (PQM) capability if 1
    DFPUCDS Deprecates FPU CS and FPU DS values if 1
    MPX Intel MPX (Memory Protection Extensions)
    PQE Supports Platform Quality of Service Enforcement (PQE) capability if 1
    AVX512F AVX-512 Foundation
    AVX512DQ AVX-512 Doubleword and Quadword Instructions
    RDSEED RDSEED instruction
    ADX Intel ADX (Multi-Precision Add-Carry Instruction Extensions)
    SMAP Supervisor Mode Access Prevention
    AVX512IFMA AVX-512 Integer Fused Multiply-Add Instructions
    PCOMMIT PCOMMIT instruction
    CLFLUSHOPT CLFLUSHOPT instruction
    CLWB CLWB instruction
    INTEL_PROCESSOR_TRACE Intel Processor Trace
    AVX512PF AVX-512 Prefetch Instructions
    AVX512ER AVX-512 Exponential and Reciprocal Instructions
    AVX512CD AVX-512 Conflict Detection Instructions
    SHA Intel SHA extensions
    AVX512BW AVX-512 Byte and Word Instructions
    AVX512VL AVX-512 Vector Length Extensions
    PREFETCHWT1 PREFETCHWT1 instruction
    AVX512VBMI AVX-512 Vector Bit Manipulation Instructions

  • func HasExtraFeature(feature uint64) bool

    LAHF_LM LahfSahf LAHF and SAHF instruction support in 64-bit mod
    CMP_LEGACY CmpLegacy Core multi-processing legacy mode.
    SVM SVM Secure virtual machine.
    EXTAPIC ExtApicSpace Extended APIC space.
    CR8_LEGACY AltMovCr8 LOCK MOV CR0 means MOV CR8.
    ABM ABM Advanced bit manipulation. LZCNT instruction support.
    SSE4A SSE4A EXTRQ, INSERTQ, MOVNTSS, and MOVNTSD instruction support.
    MISALIGNSSE Misaligned SSE mode.
    PREFETCHW PREFETCH and PREFETCHW instruction support.
    OSVW OSVW OS visible workaround. Indicates OS-visible workaround support.
    IBS IBS Instruction based sampling.
    XOP XOP Extended operation support.
    SKINIT SKINIT SKINIT and STGI are supported.
    WDT WDT Watchdog timer support.
    LWP LWP Lightweight profiling support.
    FMA4 FMA4 Four-operand FMA instruction support.
    TCE Translation Cache Extension
    NODEID_MSR NodeID MSR
    TBM TBM Trailing bit manipulation instruction support.
    TOPOEXT TopologyExtensio Topology extensions support.
    PERFCTR_CORE PerfCtrExtCore Processor performance counter extensions support.
    PERFCTR_NB PerfCtrExtNB NB performance counter extensions support.
    SPM StreamPerfMon Streaming performance monitor architecture.
    DBX DataBreakpointEx Data access breakpoint extension.
    PERFTSC PerfTsc
    PCX_L2I L2I perf counter extensions
    FPU_2 Onboard x87 FPU
    VME_2 Virtual mode extensions (VIF)
    DE_2 Debugging extensions (CR4 bit 3)
    PSE_2 Page Size Extension
    TSC_2 Time Stamp Counter
    MSR_2 Model-specific register
    PAE_2 Physical Address Extension
    MCE_2 Machine Check Exception
    CX8_2 CMPXCHG8 (compare-and-swap) instruction
    APIC_2 Onboard Advanced Programmable Interrupt Controller
    SYSCALL SYSCALL and SYSRET instructions
    MTRR_2 Memory Type Range Registers
    PGE_2 Page Global Enable bit in CR4
    MCA_2 Machine check architecture
    CMOV_2 Conditional move and FCMOV instructions
    PAT_2 Page Attribute Table
    PSE36 36-bit page size extension
    MP Multiprocessor Capable
    NX NX bit
    MMXEXT Extended MMX
    MMX_2 MMX instructions
    FXSR_2 FXSAVE, FXRSTOR instructions
    FXSR_OPT FXSAVE/FXRSTOR optimizations
    PDPE1GB Gibibyte pages
    RDTSCP RDTSCP instruction
    LM Long mode
    _3DNOWEXT Extended 3DNow!
    _3DNOW 3DNow!

Documentation

Overview

Package cpuid provides access to the information available through the CPUID instruction. All information is gathered during package initialization phase so package's public interface doesn't call CPUID instruction.

Package cpuid provides access to the information available through the CPUID instruction. All information is gathered during package initialization phase so package's public interface doesn't call CPUID instruction.

Index

Constants

View Source
const (
	UKNOWN = iota
	AMD
	CENTAUR
	CYRIX
	INTEL
	TRANSMETA
	NATIONALSEMICONDUCTOR
	NEXGEN
	RISE
	SIS
	UMC
	VIA
	VORTEX
	KVM
	HYPERV
	VMWARE
	XEN
)
View Source
const (
	SSE3 = uint64(1) << iota
	PCLMULQDQ
	DTES64
	MONITOR
	DSI_CPL
	VMX
	SMX
	EST
	TM2
	SSSE3
	CNXT_ID
	SDBG
	FMA
	CX16
	XTPR
	PDCM

	PCID
	DCA
	SSE4_1
	SSE4_2
	X2APIC
	MOVBE
	POPCNT
	TSC_DEADLINE
	AES
	XSAVE
	OSXSAVE
	AVX
	F16C
	RDRND
	HYPERVISOR
	FPU
	VME
	DE
	PSE
	TSC
	MSR
	PAE
	MCE
	CX8
	APIC

	SEP
	MTRR
	PGE
	MCA
	CMOV
	PAT
	PSE_36
	PSN
	CLFSH

	DS
	ACPI
	MMX
	FXSR
	SSE
	SSE2
	SS
	HTT
	TM
	IA64
	PBE
)
View Source
const (
	FSGSBASE = uint64(1) << iota
	IA32_TSC_ADJUST

	BMI1
	HLE
	AVX2

	SMEP
	BMI2
	ERMS
	INVPCID
	RTM
	PQM
	DFPUCDS
	MPX
	PQE
	AVX512F
	AVX512DQ
	RDSEED
	ADX
	SMAP
	AVX512IFMA
	PCOMMIT
	CLFLUSHOPT
	CLWB
	INTEL_PROCESSOR_TRACE
	AVX512PF
	AVX512ER
	AVX512CD
	SHA
	AVX512BW
	AVX512VL
	// ECX's const from there
	PREFETCHWT1
	AVX512VBMI
)
View Source
const (
	LAHF_LM = uint64(1) << iota
	CMP_LEGACY
	SVM
	EXTAPIC
	CR8_LEGACY
	ABM
	SSE4A
	MISALIGNSSE
	PREFETCHW
	OSVW
	IBS
	XOP
	SKINIT
	WDT

	LWP
	FMA4
	TCE

	NODEID_MSR

	TBM
	TOPOEXT
	PERFCTR_CORE
	PERFCTR_NB
	SPM
	DBX
	PERFTSC
	PCX_L2I

	// EDX features from there
	FPU_2
	VME_2
	DE_2
	PSE_2
	TSC_2
	MSR_2
	PAE_2
	MCE_2
	CX8_2
	APIC_2

	SYSCALL
	MTRR_2
	PGE_2
	MCA_2
	CMOV_2
	PAT_2
	PSE36

	MP
	NX

	MMXEXT
	MMX_2
	FXSR_2
	FXSR_OPT
	PDPE1GB
	RDTSCP

	LM
)
View Source
const (
	// EAX bits 0-15
	TEMPERATURE_SENSOR = uint32(1) << iota // Digital temperature sensor
	TURBO_BOOST                            // Intel Turbo Boost Technology available
	ARAT                                   // APIC-Timer-always-running feature is supported if set.

	PLN                       // Power limit notification controls
	ECMD                      // Clock modulation duty cycle extension
	PTM                       // Package thermal management
	HWP                       // HWP base registers (IA32_PM_ENABLE[bit 0], IA32_HWP_CAPABILITIES, IA32_HWP_REQUEST, IA32_HWP_STATUS)
	HWP_NOTIF                 // IA32_HWP_INTERRUPT MSR
	HWP_ACTIVITY_WINDOW       // IA32_HWP_REQUEST[bits 41:32]
	HWP_ENERGY_PERFORMANCE    // IA32_HWP_REQUEST[bits 31:24]
	HWP_PACKAGE_LEVEL_REQUEST // IA32_HWP_REQUEST_PKG MSR

	HDC             // HDC base registers IA32_PKG_HDC_CTL, IA32_PM_CTL1, IA32_THREAD_STALL MSRs
	TURBO_BOOST_MAX // Intel® Turbo Boost Max Technology

	// ECX bits 0-15
	HCFC // Hardware Coordination Feedback Capability

	PERFORMANCE_ENERGY_BIAS // Processor supports performance-energy bias preference
)

Thermal and Power Management features

View Source
const (
	NULL = iota
	DATA_CACHE
	INSTRUCTION_CACHE
	UNIFIED_CACHE
	TLB
	DTLB
	STLB
	PREFETCH
)

Variables

View Source
var CacheDescriptors []CacheDescriptor

Cache descriptor's array You can iterate like there:

for _, cacheDescription := range cpuid.CacheDescriptors {
	fmt.Printf("CacheDescriptor: %v\n", cacheDescription)
}

See CacheDescriptor type for more information

View Source
var CacheLineSize uint32

Cache line size in bytes

View Source
var DisplayFamily uint32

DisplayFamily is Family of processors obtained from processor Version Information, according to Intel® 64 and IA-32 Architectures Software Developer’s Manual

View Source
var DisplayModel uint32

Display Model is Model of processor obtained from processor Version Information, according to Intel® 64 and IA-32 Architectures Software Developer’s Manual

View Source
var EnabledAVX bool = false

EnabledAVX flag allows to check if feature AVX is enabled by OS/BIOS

View Source
var EnabledAVX512 bool = false

EnabledAVX512 flag allows to check if features AVX512xxx are enabled by OS/BIOS

View Source
var ExtendedFeatureNames = map[uint64]string{
	FSGSBASE:              "FSGSBASE",
	IA32_TSC_ADJUST:       "IA32_TSC_ADJUST",
	BMI1:                  "BMI1",
	HLE:                   "HLE",
	AVX2:                  "AVX2",
	SMEP:                  "SMEP",
	BMI2:                  "BMI2",
	ERMS:                  "ERMS",
	INVPCID:               "INVPCID",
	RTM:                   "RTM",
	PQM:                   "PQM",
	DFPUCDS:               "DFPUCDS",
	MPX:                   "MPX",
	PQE:                   "PQE",
	AVX512F:               "AVX512F",
	AVX512DQ:              "AVX512DQ",
	RDSEED:                "RDSEED",
	ADX:                   "ADX",
	SMAP:                  "SMAP",
	AVX512IFMA:            "AVX512IFMA",
	PCOMMIT:               "PCOMMIT",
	CLFLUSHOPT:            "CLFLUSHOPT",
	CLWB:                  "CLWB",
	INTEL_PROCESSOR_TRACE: "INTEL_PROCESSOR_TRACE",
	AVX512PF:              "AVX512PF",
	AVX512ER:              "AVX512ER",
	AVX512CD:              "AVX512CD",
	SHA:                   "SHA",
	AVX512BW:              "AVX512BW",
	AVX512VL:              "AVX512VL",
	PREFETCHWT1:           "PREFETCHWT1",
	AVX512VBMI:            "AVX512VBMI",
}
View Source
var ExtraFeatureNames = map[uint64]string{
	LAHF_LM:      "LAHF_LM",
	CMP_LEGACY:   "CMP_LEGACY",
	SVM:          "SVM",
	EXTAPIC:      "EXTAPIC",
	CR8_LEGACY:   "CR8_LEGACY",
	ABM:          "ABM",
	SSE4A:        "SSE4A",
	MISALIGNSSE:  "MISALIGNSSE",
	PREFETCHW:    "PREFETCHW",
	OSVW:         "OSVW",
	IBS:          "IBS",
	XOP:          "XOP",
	SKINIT:       "SKINIT",
	WDT:          "WDT",
	LWP:          "LWP",
	FMA4:         "FMA4",
	TCE:          "TCE",
	NODEID_MSR:   "NODEID_MSR",
	TBM:          "TBM",
	TOPOEXT:      "TOPOEXT",
	PERFCTR_CORE: "PERFCTR_CORE",
	PERFCTR_NB:   "PERFCTR_NB",
	SPM:          "SPM",
	DBX:          "DBX",
	PERFTSC:      "PERFTSC",
	PCX_L2I:      "PCX_L2I",
	FPU_2:        "FPU",
	VME_2:        "VME",
	DE_2:         "DE",
	PSE_2:        "PSE",
	TSC_2:        "TSC",
	MSR_2:        "MSR",
	PAE_2:        "PAE",
	MCE_2:        "MCE",
	CX8_2:        "CX8",
	APIC_2:       "APIC",
	SYSCALL:      "SYSCALL",
	MTRR_2:       "MTRR",
	PGE_2:        "PGE",
	MCA_2:        "MCA",
	CMOV_2:       "CMOV",
	PAT_2:        "PAT",
	PSE36:        "PSE36",
	MP:           "MP",
	NX:           "NX",
	MMXEXT:       "MMXEXT",
	MMX_2:        "MMX",
	FXSR_2:       "FXSR",
	FXSR_OPT:     "FXSR_OPT",
	PDPE1GB:      "PDPE1GB",
	RDTSCP:       "RDTSCP",
	LM:           "LM",
	// contains filtered or unexported fields
}
View Source
var FeatureNames = map[uint64]string{
	SSE3:         "SSE3",
	PCLMULQDQ:    "PCLMULQDQ",
	DTES64:       "DTES64",
	MONITOR:      "MONITOR",
	DSI_CPL:      "DSI_CPL",
	VMX:          "VMX",
	SMX:          "SMX",
	EST:          "EST",
	TM2:          "TM2",
	SSSE3:        "SSSE3",
	CNXT_ID:      "CNXT_ID",
	SDBG:         "SDBG",
	FMA:          "FMA",
	CX16:         "CX16",
	XTPR:         "XTPR",
	PDCM:         "PDCM",
	PCID:         "PCID",
	DCA:          "DCA",
	SSE4_1:       "SSE4_1",
	SSE4_2:       "SSE4_2",
	X2APIC:       "X2APIC",
	MOVBE:        "MOVBE",
	POPCNT:       "POPCNT",
	TSC_DEADLINE: "TSC_DEADLINE",
	AES:          "AES",
	XSAVE:        "XSAVE",
	OSXSAVE:      "OSXSAVE",
	AVX:          "AVX",
	F16C:         "F16C",
	RDRND:        "RDRND",
	HYPERVISOR:   "HYPERVISOR",
	FPU:          "FPU",
	VME:          "VME",
	DE:           "DE",
	PSE:          "PSE",
	TSC:          "TSC",
	MSR:          "MSR",
	PAE:          "PAE",
	MCE:          "MCE",
	CX8:          "CX8",
	APIC:         "APIC",
	SEP:          "SEP",
	MTRR:         "MTRR",
	PGE:          "PGE",
	MCA:          "MCA",
	CMOV:         "CMOV",
	PAT:          "PAT",
	PSE_36:       "PSE_36",
	PSN:          "PSN",
	CLFSH:        "CLFSH",
	DS:           "DS",
	ACPI:         "ACPI",
	MMX:          "MMX",
	FXSR:         "FXSR",
	SSE:          "SSE",
	SSE2:         "SSE2",
	SS:           "SS",
	HTT:          "HTT",
	TM:           "TM",
	IA64:         "IA64",
	PBE:          "PBE",
}
View Source
var InitialAPICId uint32

Initial APIC ID

View Source
var MaxLogocalCPUId uint32

Maximum number of addressable IDs for logical processors in this physical package

View Source
var MonLineSizeMax uint32

Largest monitor-line size in bytes (default is processor's monitor granularity)

View Source
var MonLineSizeMin uint32

Smallest monitor-line size in bytes (default is processor's monitor granularity)

View Source
var MonitorEMX bool

Enumeration of Monitor-Mwait extensions availability status

View Source
var MonitorIBE bool

Supports treating interrupts as break-event for MWAIT flag

View Source
var ProcessorBrandString string

ProcessorBrandString like "Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz"

View Source
var ProcessorType uint32

ProcessorType obtained from processor Version Information, according to Intel® 64 and IA-32 Architectures Software Developer’s Manual

View Source
var SteppingId uint32

SteppingId is Processor Stepping ID as described in Intel® 64 and IA-32 Architectures Software Developer’s Manual

View Source
var ThermalAndPowerFeatureNames = map[uint32]string{
	ARAT:                      "ARAT",
	PLN:                       "PLN",
	ECMD:                      "ECMD",
	PTM:                       "PTM",
	HDC:                       "HDC",
	HCFC:                      "HCFC",
	HWP:                       "HWP",
	HWP_NOTIF:                 "HWP_NOTIF",
	HWP_ACTIVITY_WINDOW:       "HWP_ACTIVITY_WINDOW",
	HWP_ENERGY_PERFORMANCE:    "HWP_ENERGY_PERFORMANCE",
	HWP_PACKAGE_LEVEL_REQUEST: "HWP_PACKAGE_LEVEL_REQUEST",
	PERFORMANCE_ENERGY_BIAS:   "PERFORMANCE_ENERGY_BIAS",
	TEMPERATURE_SENSOR:        "TEMPERATURE_SENSOR",
	TURBO_BOOST:               "TURBO_BOOST",
	TURBO_BOOST_MAX:           "TURBO_BOOST_MAX",
}
View Source
var ThermalSensorInterruptThresholds uint32

ThermalSensorInterruptThresholds is the number of interrupt thresholds in digital thermal sensor.

View Source
var VendorIdentificatorString string

VendorIdentificationString like "GenuineIntel" or "AuthenticAMD"

Functions

func HasExtendedFeature

func HasExtendedFeature(feature uint64) bool

HasExtendedFeature to check if features from ExtendedFeatureNames map are available on the current processor

func HasExtraFeature

func HasExtraFeature(feature uint64) bool

HasExtraFeature to check if features from ExtraFeatureNames map are available on the current processor

func HasFeature

func HasFeature(feature uint64) bool

HasFeature to check if features from FeatureNames map are available on the current processor

func HasThermalAndPowerFeature

func HasThermalAndPowerFeature(feature uint32) bool

HasThermalAndPowerFeature to check if features from ThermalAndPowerFeatureNames map are available on the current processor

Types

type CacheDescriptor

type CacheDescriptor struct {
	Level      int    // Cache level
	CacheType  int    // Cache type
	CacheName  string // Name
	CacheSize  int    // in KBytes (of page size for TLB)
	Ways       int    // Associativity, 0 undefined, 0xFF fully associate
	LineSize   int    // Cache line size in bytes
	Entries    int    // number of entries for TLB
	Partioning int    // partitioning
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL