Copyright | (c) Daniel Taskoff 2020 |
---|---|
License | MIT |
Maintainer | daniel.taskoff@gmail.com |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
System.LibCPUID.CPUID
Contents
Description
A wrapper around cpu_id_t from https://github.com/anrieff/libcpuid.
Usage:
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
- data CPUID = CPUID {
- vendorString :: String
- brandString :: String
- hasTSC :: Bool
- physicalCores :: Int
- logicalCores :: Int
- totalLogicalCores :: Int
- cpuid :: IO (Either String CPUID)
- isCPUIDPresent :: IO Bool
CPUID
CPU information and features.
Constructors
CPUID | |
Fields
|
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.