camfort-1.0.1: 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

Constructors

Neighbour Variable Int 
Constant (Value ()) 
NonNeighbour 

Instances

Instances details
Eq Neighbour Source # 
Instance details

Defined in Camfort.Specification.Stencils.Generate

Show Neighbour Source # 
Instance details

Defined in Camfort.Specification.Stencils.Generate

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 #