{-# LINE 1 "src/System/Libhwloc/Internal" #-} ----------------------------------------------------------------------------- -- | -- Module : System.Libhwloc.Internal -- Copyright : (c) Daniel Taskoff, 2020 -- License : MIT -- -- Maintainer : daniel.taskoff@gmail.com -- Stability : experimental ----------------------------------------------------------------------------- module System.Libhwloc.Internal ( -- * Object types ObjectType(..), toCInt -- * API version , apiVersion ) where import Foreign.C.Types (CInt (..)) -- | A type of a topology object. Wrapper around __hwloc_obj_type_t__ from https://github.com/open-mpi/hwloc. data ObjectType = Machine | Package | Core | PU | L1Cache | L2Cache | L3Cache | L4Cache | L5Cache | L1ICache | L2ICache | L3ICache | Group | NUMANode | Bridge | PCIDevice | OSDevice | Miscellaneous | MemoryCache | Die toCInt :: ObjectType -> CInt toCInt = \case Machine -> 0 {-# LINE 49 "src/System/Libhwloc/Internal" #-} Package -> 1 {-# LINE 50 "src/System/Libhwloc/Internal" #-} Core -> 2 {-# LINE 51 "src/System/Libhwloc/Internal" #-} PU -> 3 {-# LINE 52 "src/System/Libhwloc/Internal" #-} L1Cache -> 4 {-# LINE 53 "src/System/Libhwloc/Internal" #-} L2Cache -> 5 {-# LINE 54 "src/System/Libhwloc/Internal" #-} L3Cache -> 6 {-# LINE 55 "src/System/Libhwloc/Internal" #-} L4Cache -> 7 {-# LINE 56 "src/System/Libhwloc/Internal" #-} L5Cache -> 8 {-# LINE 57 "src/System/Libhwloc/Internal" #-} L1ICache -> 9 {-# LINE 58 "src/System/Libhwloc/Internal" #-} L2ICache -> 10 {-# LINE 59 "src/System/Libhwloc/Internal" #-} L3ICache -> 11 {-# LINE 60 "src/System/Libhwloc/Internal" #-} Group -> 12 {-# LINE 61 "src/System/Libhwloc/Internal" #-} NUMANode -> 13 {-# LINE 62 "src/System/Libhwloc/Internal" #-} Bridge -> 14 {-# LINE 63 "src/System/Libhwloc/Internal" #-} PCIDevice -> 15 {-# LINE 64 "src/System/Libhwloc/Internal" #-} OSDevice -> 16 {-# LINE 65 "src/System/Libhwloc/Internal" #-} Miscellaneous -> 17 {-# LINE 66 "src/System/Libhwloc/Internal" #-} MemoryCache -> 18 {-# LINE 67 "src/System/Libhwloc/Internal" #-} Die -> 19 {-# LINE 68 "src/System/Libhwloc/Internal" #-} apiVersion :: CInt apiVersion = 131328 {-# LINE 71 "src/System/Libhwloc/Internal" #-}