Safe Haskell | None |
---|---|
Language | Haskell98 |
- class Arrays (Tuple pattern) => Unlift pattern where
- unlift :: Unlift pattern => pattern -> Acc (Tuple pattern) -> Unlifted pattern
- modify :: (Lift Acc a, Unlift pattern) => pattern -> (Unlifted pattern -> a) -> Acc (Tuple pattern) -> Acc (Plain a)
- modify2 :: (Lift Acc a, Unlift patternA, Unlift patternB) => patternA -> patternB -> (Unlifted patternA -> Unlifted patternB -> a) -> Acc (Tuple patternA) -> Acc (Tuple patternB) -> Acc (Plain a)
- modify3 :: (Lift Acc a, Unlift patternA, Unlift patternB, Unlift patternC) => patternA -> patternB -> patternC -> (Unlifted patternA -> Unlifted patternB -> Unlifted patternC -> a) -> Acc (Tuple patternA) -> Acc (Tuple patternB) -> Acc (Tuple patternC) -> Acc (Plain a)
- modify4 :: (Lift Acc a, Unlift patternA, Unlift patternB, Unlift patternC, Unlift patternD) => patternA -> patternB -> patternC -> patternD -> (Unlifted patternA -> Unlifted patternB -> Unlifted patternC -> Unlifted patternD -> a) -> Acc (Tuple patternA) -> Acc (Tuple patternB) -> Acc (Tuple patternC) -> Acc (Tuple patternD) -> Acc (Plain a)
- data Acc a = Acc
- acc :: Acc a
- data Exp e = Exp
- expr :: Exp e
- unliftPair :: (Arrays a, Arrays b) => Acc (a, b) -> (Acc a, Acc b)
- unliftTriple :: (Arrays a, Arrays b, Arrays c) => Acc (a, b, c) -> (Acc a, Acc b, Acc c)
- unliftQuadruple :: (Arrays a, Arrays b, Arrays c, Arrays d) => Acc (a, b, c, d) -> (Acc a, Acc b, Acc c, Acc d)
- mapFst :: (Arrays a, Arrays b, Arrays c) => (Acc a -> Acc b) -> Acc (a, c) -> Acc (b, c)
- mapSnd :: (Arrays a, Arrays b, Arrays c) => (Acc b -> Acc c) -> Acc (a, b) -> Acc (a, c)
- singleton :: Elt e => e -> Scalar e
- the :: Elt e => Scalar e -> e
Documentation
class Arrays (Tuple pattern) => Unlift pattern where Source #
This class is like Unlift
but for the Acc
environment.
It allows you to unlift an Acc
of nested tuples
into tuples of Exp
and Acc
values.
It can be quite handy when working with acond
and awhile
.
It can also be useful in connection with running an accelerate
algorithm
at a certain backend,
like run1
.
But in this case you might prefer Data.Array.Accelerate.Utility.Lift.Run.
modify :: (Lift Acc a, Unlift pattern) => pattern -> (Unlifted pattern -> a) -> Acc (Tuple pattern) -> Acc (Plain a) Source #
modify2 :: (Lift Acc a, Unlift patternA, Unlift patternB) => patternA -> patternB -> (Unlifted patternA -> Unlifted patternB -> a) -> Acc (Tuple patternA) -> Acc (Tuple patternB) -> Acc (Plain a) Source #
modify3 :: (Lift Acc a, Unlift patternA, Unlift patternB, Unlift patternC) => patternA -> patternB -> patternC -> (Unlifted patternA -> Unlifted patternB -> Unlifted patternC -> a) -> Acc (Tuple patternA) -> Acc (Tuple patternB) -> Acc (Tuple patternC) -> Acc (Plain a) Source #
modify4 :: (Lift Acc a, Unlift patternA, Unlift patternB, Unlift patternC, Unlift patternD) => patternA -> patternB -> patternC -> patternD -> (Unlifted patternA -> Unlifted patternB -> Unlifted patternC -> Unlifted patternD -> a) -> Acc (Tuple patternA) -> Acc (Tuple patternB) -> Acc (Tuple patternC) -> Acc (Tuple patternD) -> Acc (Plain a) Source #