ghc-7.8.2: The GHC API

Safe Haskell | None
Language | Haskell98

Vectorise.Monad.Global

Contents

- Configuration
- Vars
- Vectorisation declarations
- Scalars
- TyCons
- Datacons
- PA Dictionaries
- PR Dictionaries

Synopsis

- readGEnv :: (GlobalEnv -> a) -> VM a
- setGEnv :: GlobalEnv -> VM ()
- updGEnv :: (GlobalEnv -> GlobalEnv) -> VM ()
- isVectAvoidanceAggressive :: VM Bool
- defGlobalVar :: Var -> Var -> VM ()
- undefGlobalVar :: Var -> VM ()
- lookupVectDecl :: Var -> VM (Bool, Maybe (Type, CoreExpr))
- globalParallelVars :: VM VarSet
- globalParallelTyCons :: VM NameSet
- lookupTyCon :: TyCon -> VM (Maybe TyCon)
- defTyConName :: TyCon -> Name -> TyCon -> VM ()
- defTyCon :: TyCon -> TyCon -> VM ()
- globalVectTyCons :: VM (NameEnv TyCon)
- lookupDataCon :: DataCon -> VM (Maybe DataCon)
- defDataCon :: DataCon -> DataCon -> VM ()
- lookupTyConPA :: TyCon -> VM (Maybe Var)
- defTyConPAs :: [(TyCon, Var)] -> VM ()
- lookupTyConPR :: TyCon -> VM (Maybe Var)

# Documentation

readGEnv :: (GlobalEnv -> a) -> VM a

Project something from the global environment.

setGEnv :: GlobalEnv -> VM ()

Set the value of the global environment.

updGEnv :: (GlobalEnv -> GlobalEnv) -> VM ()

Update the global environment using the provided function.

# Configuration

isVectAvoidanceAggressive :: VM Bool

Should we avoid as much vectorisation as possible?

Set by '-f[no]-vectorisation-avoidance'

# Vars

defGlobalVar :: Var -> Var -> VM ()

Add a mapping between a global var and its vectorised version to the state.

undefGlobalVar :: Var -> VM ()

Remove the mapping of a variable in the vectorisation map.

# Vectorisation declarations

lookupVectDecl :: Var -> VM (Bool, Maybe (Type, CoreExpr))

Check whether a variable has a vectorisation declaration.

The first component of the result indicates whether the variable has a `NOVECTORISE` declaration. The second component contains the given type and expression in case of a `VECTORISE` declaration.

# Scalars

globalParallelVars :: VM VarSet

Get the set of global parallel variables.

globalParallelTyCons :: VM NameSet

Get the set of all parallel type constructors (those that may embed parallelism) including both both those parallel type constructors declared in an imported module and those declared in the current module.

# TyCons

lookupTyCon :: TyCon -> VM (Maybe TyCon)

Determine the vectorised version of a `TyCon`. The vectorisation map in the global environment contains a vectorised version if the original `TyCon` embeds any parallel arrays.

defTyConName :: TyCon -> Name -> TyCon -> VM ()

Add a mapping between plain and vectorised `TyCon`s to the global environment.

The second argument is only to enable tracing for (mutually) recursively defined type constructors, where we must not pull at the vectorised type constructors (because that would pull too early at the recursive knot).

defTyCon :: TyCon -> TyCon -> VM ()

Add a mapping between plain and vectorised `TyCon`s to the global environment.

globalVectTyCons :: VM (NameEnv TyCon)

Get the set of all vectorised type constructors.

# Datacons

lookupDataCon :: DataCon -> VM (Maybe DataCon)

Lookup the vectorised version of a `DataCon` from the global environment.

defDataCon :: DataCon -> DataCon -> VM ()

Add the mapping between plain and vectorised `DataCon`s to the global environment.

# PA Dictionaries

lookupTyConPA :: TyCon -> VM (Maybe Var)

Lookup the `PA` dfun of a vectorised type constructor in the global environment.

defTyConPAs :: [(TyCon, Var)] -> VM ()

Associate vectorised type constructors with the dfun of their `PA` instances in the global environment.

# PR Dictionaries

lookupTyConPR :: TyCon -> VM (Maybe Var)