module Test.SBench.Space.OptionSet where
import Test.SBench.Options
import Test.SBench.STerm ( Algorithm, STerm(..) )
generalCOpts :: CompilerOptions
generalCOpts =
[ "--make"
, "-prof"
, "-rtsopts"
]
defltCOpts :: CompilerOptions
defltCOpts =
[ "-auto-all"
, "-caf-all"
, "-O2"
]
defltRep :: Maybe Repetitions
defltRep = Nothing
defltProfOpts :: ProfilingOptions
defltProfOpts =
[ PPBreakdown BCostCentreStack
, PPInterval 0.02
, PPNameLength 60
]
defltTestOpts :: TestOpts
defltTestOpts = TOpts
{ cOpts = defltCOpts
, rOpts = ROpts
{ threadNum = Nothing
, profOpts = defltProfOpts
, memOpts = []
, progArgs = []
}
, reps = Nothing
, nfInp = False
}
addCC :: Algorithm a -> TestOpts -> TestOpts
addCC alg opts =
opts {
rOpts = (rOpts opts) {
profOpts = PPRestriction RCCStackAny (stCC alg) : (profOpts (rOpts opts))
}
}
setRepetitions :: Repetitions -> TestOpts -> TestOpts
setRepetitions rep opts = opts { reps = Just rep }
autoRepeat :: TestOpts -> TestOpts
autoRepeat opts = opts { reps = Nothing }
setMemSizes :: [MemSize] -> TestOpts -> TestOpts
setMemSizes ms opts =
opts {rOpts = (rOpts opts) {memOpts = ms } }
setNfInput :: Bool -> TestOpts -> TestOpts
setNfInput b opts = opts { nfInp = b }