futhark-0.11.1: An optimising compiler for a functional, array-oriented language.

Safe HaskellNone
LanguageHaskell2010

Futhark.Representation.SOACS.SOAC

Contents

Synopsis

Documentation

data SOAC lore Source #

Constructors

Stream SubExp (StreamForm lore) (Lambda lore) [VName] 
Scatter SubExp (Lambda lore) [VName] [(SubExp, Int, VName)] 
GenReduce SubExp [GenReduceOp lore] (Lambda lore) [VName] 
Screma SubExp (ScremaForm lore) [VName]

A combination of scan, reduction, and map. The first BasicOp is the size of the input arrays. The first 'Lambda'/'SubExp' pair is for scan and its neutral elements. The second is for the reduction. The final lambda is for the map part, and finally comes the input arrays.

CmpThreshold SubExp String 
Instances
Annotations lore => Eq (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

(==) :: SOAC lore -> SOAC lore -> Bool #

(/=) :: SOAC lore -> SOAC lore -> Bool #

Annotations lore => Ord (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

compare :: SOAC lore -> SOAC lore -> Ordering #

(<) :: SOAC lore -> SOAC lore -> Bool #

(<=) :: SOAC lore -> SOAC lore -> Bool #

(>) :: SOAC lore -> SOAC lore -> Bool #

(>=) :: SOAC lore -> SOAC lore -> Bool #

max :: SOAC lore -> SOAC lore -> SOAC lore #

min :: SOAC lore -> SOAC lore -> SOAC lore #

Annotations lore => Show (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

showsPrec :: Int -> SOAC lore -> ShowS #

show :: SOAC lore -> String #

showList :: [SOAC lore] -> ShowS #

PrettyLore lore => Pretty (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

ppr :: SOAC lore -> Doc #

pprPrec :: Int -> SOAC lore -> Doc #

pprList :: [SOAC lore] -> Doc #

TypedOp (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

opType :: HasScope t m => SOAC lore -> m [ExtType] Source #

Attributes lore => FreeIn (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

freeIn :: SOAC lore -> Names Source #

Attributes lore => Substitute (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

substituteNames :: Map VName VName -> SOAC lore -> SOAC lore Source #

Attributes lore => Rename (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

rename :: SOAC lore -> RenameM (SOAC lore) Source #

Attributes lore => IsOp (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

safeOp :: SOAC lore -> Bool Source #

cheapOp :: SOAC lore -> Bool Source #

(Attributes lore, Attributes (Aliases lore), CanBeAliased (Op lore)) => CanBeAliased (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Associated Types

type OpWithAliases (SOAC lore) :: Type Source #

(Attributes lore, Aliased lore) => AliasedOp (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

opAliases :: SOAC lore -> [Names] Source #

consumedInOp :: SOAC lore -> Names Source #

OpMetrics (Op lore) => OpMetrics (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

opMetrics :: SOAC lore -> MetricsM () Source #

(Attributes lore, CanBeRanged (Op lore)) => CanBeRanged (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Associated Types

type OpWithRanges (SOAC lore) :: Type Source #

Methods

removeOpRanges :: OpWithRanges (SOAC lore) -> SOAC lore Source #

addOpRanges :: SOAC lore -> OpWithRanges (SOAC lore) Source #

Ranged inner => RangedOp (SOAC inner) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

opRanges :: SOAC inner -> [Range] Source #

(Attributes lore, CanBeWise (Op lore)) => CanBeWise (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Associated Types

type OpWithWisdom (SOAC lore) :: Type Source #

Methods

removeOpWisdom :: OpWithWisdom (SOAC lore) -> SOAC lore Source #

Annotations lore => IndexOp (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

indexOp :: (Attributes lore0, IndexOp (Op lore0)) => SymbolTable lore0 -> Int -> SOAC lore -> [PrimExp VName] -> Maybe (PrimExp VName, Certificates) Source #

(Attributes lore, CanBeAliased (Op lore), CSEInOp (OpWithAliases (Op lore))) => CSEInOp (SOAC (Aliases lore)) Source # 
Instance details

Defined in Futhark.Optimise.CSE

Methods

cseInOp :: SOAC (Aliases lore) -> CSEM lore0 (SOAC (Aliases lore))

type OpWithAliases (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

type OpWithAliases (SOAC lore) = SOAC (Aliases lore)
type OpWithRanges (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

type OpWithRanges (SOAC lore) = SOAC (Ranges lore)
type OpWithWisdom (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

type OpWithWisdom (SOAC lore) = SOAC (Wise lore)

data StreamForm lore Source #

Instances
Annotations lore => Eq (StreamForm lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

(==) :: StreamForm lore -> StreamForm lore -> Bool #

(/=) :: StreamForm lore -> StreamForm lore -> Bool #

Annotations lore => Ord (StreamForm lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

compare :: StreamForm lore -> StreamForm lore -> Ordering #

(<) :: StreamForm lore -> StreamForm lore -> Bool #

(<=) :: StreamForm lore -> StreamForm lore -> Bool #

(>) :: StreamForm lore -> StreamForm lore -> Bool #

(>=) :: StreamForm lore -> StreamForm lore -> Bool #

max :: StreamForm lore -> StreamForm lore -> StreamForm lore #

min :: StreamForm lore -> StreamForm lore -> StreamForm lore #

Annotations lore => Show (StreamForm lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

showsPrec :: Int -> StreamForm lore -> ShowS #

show :: StreamForm lore -> String #

showList :: [StreamForm lore] -> ShowS #

data ScremaForm lore Source #

The essential parts of a Screma factored out (everything except the input arrays).

Constructors

ScremaForm (Scan lore) [Reduce lore] (Lambda lore) 
Instances
Annotations lore => Eq (ScremaForm lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

(==) :: ScremaForm lore -> ScremaForm lore -> Bool #

(/=) :: ScremaForm lore -> ScremaForm lore -> Bool #

Annotations lore => Ord (ScremaForm lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

compare :: ScremaForm lore -> ScremaForm lore -> Ordering #

(<) :: ScremaForm lore -> ScremaForm lore -> Bool #

(<=) :: ScremaForm lore -> ScremaForm lore -> Bool #

(>) :: ScremaForm lore -> ScremaForm lore -> Bool #

(>=) :: ScremaForm lore -> ScremaForm lore -> Bool #

max :: ScremaForm lore -> ScremaForm lore -> ScremaForm lore #

min :: ScremaForm lore -> ScremaForm lore -> ScremaForm lore #

Annotations lore => Show (ScremaForm lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

showsPrec :: Int -> ScremaForm lore -> ShowS #

show :: ScremaForm lore -> String #

showList :: [ScremaForm lore] -> ShowS #

data GenReduceOp lore Source #

Instances
Annotations lore => Eq (GenReduceOp lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

(==) :: GenReduceOp lore -> GenReduceOp lore -> Bool #

(/=) :: GenReduceOp lore -> GenReduceOp lore -> Bool #

Annotations lore => Ord (GenReduceOp lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

compare :: GenReduceOp lore -> GenReduceOp lore -> Ordering #

(<) :: GenReduceOp lore -> GenReduceOp lore -> Bool #

(<=) :: GenReduceOp lore -> GenReduceOp lore -> Bool #

(>) :: GenReduceOp lore -> GenReduceOp lore -> Bool #

(>=) :: GenReduceOp lore -> GenReduceOp lore -> Bool #

max :: GenReduceOp lore -> GenReduceOp lore -> GenReduceOp lore #

min :: GenReduceOp lore -> GenReduceOp lore -> GenReduceOp lore #

Annotations lore => Show (GenReduceOp lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

showsPrec :: Int -> GenReduceOp lore -> ShowS #

show :: GenReduceOp lore -> String #

showList :: [GenReduceOp lore] -> ShowS #

type Scan lore = (Lambda lore, [SubExp]) Source #

data Reduce lore Source #

Constructors

Reduce 
Instances
Annotations lore => Eq (Reduce lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

(==) :: Reduce lore -> Reduce lore -> Bool #

(/=) :: Reduce lore -> Reduce lore -> Bool #

Annotations lore => Ord (Reduce lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

compare :: Reduce lore -> Reduce lore -> Ordering #

(<) :: Reduce lore -> Reduce lore -> Bool #

(<=) :: Reduce lore -> Reduce lore -> Bool #

(>) :: Reduce lore -> Reduce lore -> Bool #

(>=) :: Reduce lore -> Reduce lore -> Bool #

max :: Reduce lore -> Reduce lore -> Reduce lore #

min :: Reduce lore -> Reduce lore -> Reduce lore #

Annotations lore => Show (Reduce lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

showsPrec :: Int -> Reduce lore -> ShowS #

show :: Reduce lore -> String #

showList :: [Reduce lore] -> ShowS #

PrettyLore lore => Pretty (Reduce lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

ppr :: Reduce lore -> Doc #

pprPrec :: Int -> Reduce lore -> Doc #

pprList :: [Reduce lore] -> Doc #

redResults :: [Reduce lore] -> Int Source #

How many reduction results are produced by these Reduces?

singleReduce :: Bindable lore => [Reduce lore] -> Reduce lore Source #

Combine multiple reduction operators to a single operator.

Utility

getStreamAccums :: StreamForm lore -> [SubExp] Source #

Get Stream's accumulators as a sub-expression list

soacType :: SOAC lore -> [Type] Source #

typeCheckSOAC :: Checkable lore => SOAC (Aliases lore) -> TypeM lore () Source #

mkIdentityLambda :: (Bindable lore, MonadFreshNames m) => [Type] -> m (Lambda lore) Source #

Construct a lambda that takes parameters of the given types and simply returns them unchanged.

isIdentityLambda :: Lambda lore -> Bool Source #

Is the given lambda an identity lambda?

composeLambda :: (Bindable lore, BinderOps lore, MonadFreshNames m, HasScope somelore m, SameScope somelore lore) => Lambda lore -> Lambda lore -> Lambda lore -> m (Lambda lore) Source #

nilFn :: Bindable lore => Lambda lore Source #

A lambda with no parameters that returns no values.

scanomapSOAC :: Lambda lore -> [SubExp] -> Lambda lore -> ScremaForm lore Source #

redomapSOAC :: Bindable lore => [Reduce lore] -> Lambda lore -> ScremaForm lore Source #

scanSOAC :: (Bindable lore, MonadFreshNames m) => Lambda lore -> [SubExp] -> m (ScremaForm lore) Source #

reduceSOAC :: (Bindable lore, MonadFreshNames m) => [Reduce lore] -> m (ScremaForm lore) Source #

mapSOAC :: Bindable lore => Lambda lore -> ScremaForm lore Source #

isRedomapSOAC :: ScremaForm lore -> Maybe ([Reduce lore], Lambda lore) Source #

ppScrema :: (PrettyLore lore, Pretty inp) => SubExp -> ScremaForm lore -> [inp] -> Doc Source #

ppGenReduce :: (PrettyLore lore, Pretty inp) => SubExp -> [GenReduceOp lore] -> Lambda lore -> [inp] -> Doc Source #

Generic traversal

data SOACMapper flore tlore m Source #

Like Mapper, but just for SOACs.

Constructors

SOACMapper 

Fields

identitySOACMapper :: Monad m => SOACMapper lore lore m Source #

A mapper that simply returns the SOAC verbatim.

mapSOACM :: (Applicative m, Monad m) => SOACMapper flore tlore m -> SOAC flore -> m (SOAC tlore) Source #

Map a monadic action across the immediate children of a SOAC. The mapping does not descend recursively into subexpressions and is done left-to-right.