futhark-0.15.5: An optimising compiler for a functional, array-oriented language.
Safe HaskellNone
LanguageHaskell2010

Futhark.Representation.Kernels

Description

A representation with flat parallelism via GPU-oriented kernels.

Synopsis

The Lore definition

data Kernels Source #

Instances

Instances details
Annotations Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

PrettyLore Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

Attributes Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

Bindable Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

BinderOps Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

Checkable Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

CheckableOp Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

Scoped Kernels LoopNesting Source # 
Instance details

Defined in Futhark.Pass.ExtractKernels.Distribution

Monad m => LocalScope Kernels (DistNestT m) Source # 
Instance details

Defined in Futhark.Pass.ExtractKernels.DistributeNests

Monad m => HasScope Kernels (DistNestT m) Source # 
Instance details

Defined in Futhark.Pass.ExtractKernels.DistributeNests

BinderOps (Wise Kernels) Source # 
Instance details

Defined in Futhark.Representation.Kernels.Simplify

type LetAttr Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

type ExpAttr Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

type ExpAttr Kernels = ()
type BodyAttr Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

type BodyAttr Kernels = ()
type FParamAttr Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

type LParamAttr Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

type RetType Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

type BranchType Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

type Op Kernels Source # 
Instance details

Defined in Futhark.Representation.Kernels

Module re-exports

data SOACMapper flore tlore m Source #

Like Mapper, but just for SOACs.

Constructors

SOACMapper 

Fields

data Reduce lore Source #

Constructors

Reduce 

Instances

Instances details
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

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

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

Instances details
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 StreamForm lore Source #

Instances

Instances details
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 SOAC lore Source #

Constructors

Stream SubExp (StreamForm lore) (Lambda lore) [VName] 
Scatter SubExp (Lambda lore) [VName] [(SubExp, Int, VName)] 
Hist SubExp [HistOp lore] (Lambda lore) [VName] 
Screma SubExp (ScremaForm lore) [VName]

A combination of scan, reduction, and map. The first SubExp 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

Instances details
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 -> FV 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) 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) 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) 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 Indexed 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)

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.

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?

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 #

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.

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

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

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

Get Stream's accumulators as a sub-expression list

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

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