| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Futhark.Pass.Flatten.Distribute
Contents
Synopsis
- distributeMap :: DistIrregularity -> FunHasParallelism -> Scope rep -> Pat Type -> Segments -> [MapArray t] -> Lambda SOACS -> (Distributed, Map ResTag t)
- distributeBody :: DistIrregularity -> FunHasParallelism -> Scope rep -> Segments -> DistInputs -> Body SOACS -> (DistInputs, DistStms)
- data MapArray t
- mapArrayRowType :: MapArray t -> Type
- data DistResults = DistResults ResMap [DistRep]
- type DistRep = (VName, Either SubExp DistInput)
- type ResMap = Map ResTag [([DistInput], VName, Type)]
- data Distributed = Distributed DistStms DistResults
- data DistStm = DistStm {}
- type DistStms = Seq DistStm
- data DistBody
- data DistInput
- type DistInputs = [(VName, DistInput)]
- data DistType = DistType Segments Rank Type
- distInputType :: DistInput -> Type
- data DistResult = DistResult {}
- newtype ResTag = ResTag Int
- data DistIrregularity
- type FunHasParallelism = Name -> Bool
- isRegularDistResult :: DistResult -> Bool
- isParallelStm :: FunHasParallelism -> Stm SOACS -> Bool
- stmHasMeaningfulParallelism :: FunHasParallelism -> Stm SOACS -> Bool
- type Segments = [SubExp]
- segmentsShape :: Segments -> Shape
- segmentsRank :: Segments -> Int
- segmentCount :: Segments -> TPrimExp Int64 VName
Documentation
distributeMap :: DistIrregularity -> FunHasParallelism -> Scope rep -> Pat Type -> Segments -> [MapArray t] -> Lambda SOACS -> (Distributed, Map ResTag t) Source #
distributeBody :: DistIrregularity -> FunHasParallelism -> Scope rep -> Segments -> DistInputs -> Body SOACS -> (DistInputs, DistStms) Source #
The input we are mapping over in distributeMap.
mapArrayRowType :: MapArray t -> Type Source #
data DistResults Source #
Constructors
| DistResults ResMap [DistRep] |
Instances
| Show DistResults Source # | |
Defined in Futhark.Pass.Flatten.Distribute Methods showsPrec :: Int -> DistResults -> ShowS # show :: DistResults -> String # showList :: [DistResults] -> ShowS # | |
| Eq DistResults Source # | |
Defined in Futhark.Pass.Flatten.Distribute | |
| Ord DistResults Source # | |
Defined in Futhark.Pass.Flatten.Distribute Methods compare :: DistResults -> DistResults -> Ordering # (<) :: DistResults -> DistResults -> Bool # (<=) :: DistResults -> DistResults -> Bool # (>) :: DistResults -> DistResults -> Bool # (>=) :: DistResults -> DistResults -> Bool # max :: DistResults -> DistResults -> DistResults # min :: DistResults -> DistResults -> DistResults # | |
type DistRep = (VName, Either SubExp DistInput) Source #
The results of a map-distribution that were free or identity mapped in the original map function. These correspond to plain replicated arrays.
type ResMap = Map ResTag [([DistInput], VName, Type)] Source #
First element of tuple are certificates for this result.
Second is the name to which is should be bound.
Third is the element type (i.e. excluding shape of segments).
data Distributed Source #
Constructors
| Distributed DistStms DistResults |
Instances
| Show Distributed Source # | |
Defined in Futhark.Pass.Flatten.Distribute Methods showsPrec :: Int -> Distributed -> ShowS # show :: Distributed -> String # showList :: [Distributed] -> ShowS # | |
| Eq Distributed Source # | |
Defined in Futhark.Pass.Flatten.Distribute | |
| Ord Distributed Source # | |
Defined in Futhark.Pass.Flatten.Distribute Methods compare :: Distributed -> Distributed -> Ordering # (<) :: Distributed -> Distributed -> Bool # (<=) :: Distributed -> Distributed -> Bool # (>) :: Distributed -> Distributed -> Bool # (>=) :: Distributed -> Distributed -> Bool # max :: Distributed -> Distributed -> Distributed # min :: Distributed -> Distributed -> Distributed # | |
| Pretty Distributed Source # | |
Defined in Futhark.Pass.Flatten.Distribute | |
Constructors
| DistStm | |
Fields | |
The body of a distributed statement.
Constructors
| ParallelStm (Stm SOACS) | A single statement that may involve parallel operations or produce an irregular array. |
| ScalarStm (Stms SOACS) | Single or Multiple scalar operations grouped into a single traversal |
Something that is mapped.
Constructors
| DistInputFree VName Type | A value bound outside the original map-nest. By necessity regular. The type is the parameter type. |
| DistInput ResTag Type | A value constructed inside the original map-nest. May be irregular. |
Instances
| Show DistInput Source # | |
| Eq DistInput Source # | |
| Ord DistInput Source # | |
| Pretty DistInput Source # | |
Defined in Futhark.Pass.Flatten.Distribute | |
type DistInputs = [(VName, DistInput)] Source #
Constructors
| DistType | |
distInputType :: DistInput -> Type Source #
The type of a DistInput. This corresponds to the parameter
type of the original map-nest.
data DistResult Source #
Constructors
| DistResult | |
Fields
| |
Instances
| Show DistResult Source # | |
Defined in Futhark.Pass.Flatten.Distribute Methods showsPrec :: Int -> DistResult -> ShowS # show :: DistResult -> String # showList :: [DistResult] -> ShowS # | |
| Eq DistResult Source # | |
Defined in Futhark.Pass.Flatten.Distribute | |
| Ord DistResult Source # | |
Defined in Futhark.Pass.Flatten.Distribute Methods compare :: DistResult -> DistResult -> Ordering # (<) :: DistResult -> DistResult -> Bool # (<=) :: DistResult -> DistResult -> Bool # (>) :: DistResult -> DistResult -> Bool # (>=) :: DistResult -> DistResult -> Bool # max :: DistResult -> DistResult -> DistResult # min :: DistResult -> DistResult -> DistResult # | |
| Pretty DistResult Source # | |
Defined in Futhark.Pass.Flatten.Distribute | |
data DistIrregularity Source #
How to treat irregularity when classifying the statements of a distributed body. This is mainly used to sequentialise nonuniform nested parallelism instead of actually exploiting the parallelism, as the overhead of doing so can sometimes be ruinous.
Constructors
| DistributeIrregular | Distribute statements involving irregularity, relying on the machinery for flattening irregular arrays to handle them. |
| SequentialiseIrregularBasicOps | Sequentialise BasicOps that involve only internal nonuniformity instead
of distributing them. Used when generating intrablock code, where the
machinery for flattening nonuniform nested parallelism would produce
SegOps whose sizes are bound inside the kernel body, which makes the
enclosing intrablock kernel infeasible ( |
| SequentialiseIrregularAll | Sequentialise any statement whose nonuniformity stays internal. |
Instances
| Show DistIrregularity Source # | |
Defined in Futhark.Pass.Flatten.Distribute Methods showsPrec :: Int -> DistIrregularity -> ShowS # show :: DistIrregularity -> String # showList :: [DistIrregularity] -> ShowS # | |
| Eq DistIrregularity Source # | |
Defined in Futhark.Pass.Flatten.Distribute Methods (==) :: DistIrregularity -> DistIrregularity -> Bool # (/=) :: DistIrregularity -> DistIrregularity -> Bool # | |
type FunHasParallelism = Name -> Bool Source #
isRegularDistResult :: DistResult -> Bool Source #
isParallelStm :: FunHasParallelism -> Stm SOACS -> Bool Source #
Segments
type Segments = [SubExp] Source #
Widths of the enclosing map-nest, outermost first. For top-level parallel
constructs, this is empty, which should be treated as an implicit
single-element segment (see segmentCount). Generally, the empty-segments
case must be treated specially in some places, which is unfortunate, but it
helps unify code between the nested and top level cases.
segmentsShape :: Segments -> Shape Source #
segmentsRank :: Segments -> Int Source #