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 |
- type EvalLog = [(String, Variable)]
- data Neighbour
- extractRelevantIVS :: (Spanned (ast (Analysis A)), Annotated ast) => InductionVarMapByASTBlock -> ast (Analysis A) -> [Variable]
- assocsSequence :: Monad m => Map k (m (Maybe a)) -> m [(k, a)]
- genSpecifications :: FlowsGraph A -> [Variable] -> [Neighbour] -> Block (Analysis A) -> Writer EvalLog ([([Variable], Specification)], [Int])
- genSubscripts :: FlowsGraph A -> [Block (Analysis A)] -> (Map Variable [[Index (Analysis A)]], [Int])
- isArraySubscript :: Expression (Analysis A) -> Maybe [Index (Analysis A)]
- neighbourIndex :: InductionVarMapByASTBlock -> [Index (Analysis A)] -> Maybe [Neighbour]
- isVariableExpr :: Expression a -> Bool
- convIxToNeighbour :: [Variable] -> Index (Analysis Annotation) -> Neighbour
- indicesToRelativisedOffsets :: [Variable] -> Variable -> [Neighbour] -> [[Index (Analysis Annotation)]] -> Writer EvalLog (Maybe (Bool, [[Int]]))
- indicesToSpec :: [Variable] -> Variable -> [Neighbour] -> [[Index (Analysis Annotation)]] -> Writer EvalLog (Maybe Specification)
- neighbourToOffset :: Neighbour -> Maybe Int
- relativise :: [Neighbour] -> [[Neighbour]] -> [[Neighbour]]
Documentation
Representation for indices as either: * neighbour indices * constant * non neighbour index
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
genSpecifications :: FlowsGraph A -> [Variable] -> [Neighbour] -> Block (Analysis A) -> Writer EvalLog ([([Variable], Specification)], [Int]) Source #
genSubscripts :: FlowsGraph A -> [Block (Analysis A)] -> (Map Variable [[Index (Analysis A)]], [Int]) Source #
genSubscripts Takes * a flows graph * a list of blocks representing an RHS Returns a map from array variables to indices, and a list of nodes that were visited when computing this information
isArraySubscript :: Expression (Analysis A) -> Maybe [Index (Analysis A)] Source #
Match expressions which are array subscripts, returning Just of their index expressions, else Nothing
neighbourIndex :: 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
isVariableExpr :: Expression a -> Bool Source #
convIxToNeighbour :: [Variable] -> Index (Analysis Annotation) -> 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 :: [Variable] -> Variable -> [Neighbour] -> [[Index (Analysis Annotation)]] -> Writer EvalLog (Maybe (Bool, [[Int]])) Source #
indicesToSpec :: [Variable] -> Variable -> [Neighbour] -> [[Index (Analysis Annotation)]] -> Writer EvalLog (Maybe Specification) Source #