Copyright | (c) 2017 Dominic Orchard Andrew Rice Mistral Contrastin Matthew Danish |
---|---|
License | Apache-2.0 |
Maintainer | dom.orchard@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type EvalLog = [(String, Variable)]
- data Neighbour
- = Neighbour Variable Int
- | Constant (Value ())
- | NonNeighbour
- extractRelevantIVS :: (Spanned (ast (Analysis a)), Annotated ast) => InductionVarMapByASTBlock -> ast (Analysis a) -> [Variable]
- genOffsets :: (Data a, Show a, Eq a) => [Neighbour] -> [Block (Analysis a)] -> StencilInferer a [(Variable, (Bool, [[Int]]))]
- genSpecifications :: (Data a, Show a, Eq a) => [Neighbour] -> Block (Analysis a) -> StencilInferer a ([([Variable], Specification)], [Int])
- isArraySubscript :: Expression (Analysis a) -> Maybe [Index (Analysis a)]
- neighbourIndex :: Data a => InductionVarMapByASTBlock -> [Index (Analysis a)] -> Maybe [Neighbour]
- runStencilInferer :: StencilInferer ann a -> [Variable] -> FlowsGraph ann -> StencilsAnalysis (a, EvalLog)
- isVariableExpr :: Expression a -> Bool
- convIxToNeighbour :: Data a => [Variable] -> Index (Analysis a) -> Neighbour
- indicesToRelativisedOffsets :: Data a => Variable -> [Neighbour] -> Indices a -> StencilInferer a (Maybe (Bool, [[Int]]))
- indicesToSpec :: Data a => Variable -> [Neighbour] -> Indices a -> StencilInferer a (Maybe Specification)
- neighbourToOffset :: Neighbour -> Maybe Int
- relativise :: [Neighbour] -> [[Neighbour]] -> [[Neighbour]]
- consistentIVSuse :: [Neighbour] -> [[Neighbour]] -> Bool
Documentation
Representation for indices as either: * neighbour indices * constant * non neighbour index
Neighbour Variable Int | |
Constant (Value ()) | |
NonNeighbour |
extractRelevantIVS :: (Spanned (ast (Analysis a)), Annotated ast) => InductionVarMapByASTBlock -> ast (Analysis a) -> [Variable] Source #
Given an induction variable map, and a piece of syntax return a list of induction variables in scope for this index
genOffsets :: (Data a, Show a, Eq a) => [Neighbour] -> [Block (Analysis a)] -> StencilInferer a [(Variable, (Bool, [[Int]]))] Source #
genSpecifications :: (Data a, Show a, Eq a) => [Neighbour] -> Block (Analysis a) -> StencilInferer a ([([Variable], Specification)], [Int]) Source #
isArraySubscript :: Expression (Analysis a) -> Maybe [Index (Analysis a)] Source #
Match expressions which are array subscripts, returning Just of their index expressions, else Nothing
neighbourIndex :: Data a => InductionVarMapByASTBlock -> [Index (Analysis a)] -> Maybe [Neighbour] Source #
Given an induction-variable-map, convert a list of indices to Maybe a list of constant or neighbourhood indices. If any are non neighbourhood then return Nothing
runStencilInferer :: StencilInferer ann a -> [Variable] -> FlowsGraph ann -> StencilsAnalysis (a, EvalLog) Source #
isVariableExpr :: Expression a -> Bool Source #
convIxToNeighbour :: Data a => [Variable] -> Index (Analysis a) -> Neighbour Source #
Given a list of induction variables and an index, compute its Neighbour representation e.g., for the expression a(i+1,j-1) then this function gets passed expr = i + 1 (returning +1) and expr = j - 1 (returning -1)
indicesToRelativisedOffsets :: Data a => Variable -> [Neighbour] -> Indices a -> StencilInferer a (Maybe (Bool, [[Int]])) Source #
indicesToSpec :: Data a => Variable -> [Neighbour] -> Indices a -> StencilInferer a (Maybe Specification) Source #