{-# OPTIONS_HADDOCK hide #-}
module Data.Array.Accelerate.Trafo.Config (
Config(..),
Flag(..),
defaultOptions,
) where
import Data.Bits
import Data.BitSet
import Data.Array.Accelerate.Debug.Flags as F
import Data.Word
import System.IO.Unsafe
import Foreign.Storable
data Config = Config
{ options :: {-# UNPACK #-} !(BitSet Word32 Flag)
, unfolding_use_threshold :: {-# UNPACK #-} !Int
, max_simplifier_iterations :: {-# UNPACK #-} !Int
}
deriving Show
{-# NOINLINE defaultOptions #-}
defaultOptions :: Config
defaultOptions = unsafePerformIO $!
Config <$> (BitSet . (0x80000000 .|.)) <$> peek F.__cmd_line_flags
<*> (fromIntegral <$> F.getValue F.unfolding_use_threshold)
<*> (fromIntegral <$> F.getValue F.max_simplifier_iterations)