camfort-0.904: CamFort - Cambridge Fortran infrastructure

Copyright(c) 2017 Dominic Orchard Andrew Rice Mistral Contrastin Matthew Danish
LicenseApache-2.0
Maintainerdom.orchard@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Camfort.Specification.Stencils.Generate

Description

 

Synopsis

Documentation

data Neighbour Source #

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

assocsSequence :: Monad m => Map k (m (Maybe a)) -> m [(k, a)] 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

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)