| Copyright | (c) Daniel Taskoff 2020 |
|---|---|
| License | MIT |
| Maintainer | [email protected] |
| Stability | experimental |
| Safe Haskell | Safe |
| Language | Haskell2010 |
System.LibCPUID
Description
Bindings to https://github.com/anrieff/libcpuid.
Currently implemented features:
cpuid >>= \case
Left err -> error err
Right CPUID {..} -> do
mapM_ putStrLn
[ "Available CPU information"
, "------------------------------------------"
, "vendor string: " ++ vendorString
, "brand string: " ++ brandString
, "has a time-stamp counter (TSC): " ++ if hasTSC then "yes" else "no"
, "# physical cores per processor: " ++ show physicalCores
, "# logical cores per processor: " ++ show logicalCores
, "# processors: " ++ show (div totalLogicalCores logicalCores)
]Synopsis
- cpuid :: IO (Either String CPUID)
- isCPUIDPresent :: IO Bool
- getTotalLogicalCores :: IO Int
- data CPUID = CPUID {
- vendorString :: String
- brandString :: String
- hasTSC :: Bool
- physicalCores :: Int
- logicalCores :: Int
- totalLogicalCores :: Int
LibCPUID
cpuid :: IO (Either String CPUID) Source #
Get CPU information and features, or an error message, if the CPU can't be identified by libcpuid.
isCPUIDPresent :: IO Bool Source #
Check if the CPUID instruction is supported.
getTotalLogicalCores :: IO Int Source #
Get the total number of logical cores (even if CPUID is not present). If CPUID is present, the following is true:
Reexports
CPU information and features.
Constructors
| CPUID | |
Fields
| |