futhark-0.9.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) (LambdaT lore) [VName] 
Scatter SubExp (LambdaT lore) [VName] [(SubExp, Int, VName)] 
GenReduce SubExp [GenReduceOp lore] (LambdaT 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 #

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

Defined in Futhark.Representation.SOACS.SOAC

Methods

freeIn :: SOAC lore -> Names Source #

TypedOp (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

opType :: HasScope t m => SOAC lore -> m [ExtType] 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 #

Aliased lore => UsageInOp (SOAC lore) Source # 
Instance details

Defined in Futhark.Representation.SOACS.SOAC

Methods

usageInOp :: SOAC lore -> UsageTable 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) (LambdaT 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 = (LambdaT lore, [SubExp]) Source #

type Reduce lore = (Commutativity, LambdaT lore, [SubExp]) Source #

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 => LambdaT lore Source #

A lambda with no parameters that returns no values.

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

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

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

mapSOAC :: Bindable lore => Lambda lore -> ScremaForm 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.