- data Feldspar role a where
- Literal :: (Type a, MetaType () a) => a -> Feldspar (Out ()) a
- Function :: (Typeable (a -> b), MetaType () b) => String -> (a -> b) -> Feldspar (In ra -> Out ()) (a -> b)
- Pair :: (Type a, Type b, MetaType () (a, b)) => Feldspar (In () -> In () -> Out ()) (a -> b -> (a, b))
- Condition :: MetaType ra a => Feldspar (In () -> In ra -> In ra -> Out ra) (Bool -> a -> a -> a)
- Parallel :: (Type a, MetaType () [a]) => Feldspar (In () -> (Out () -> In ()) -> In () -> Out ()) (Length -> (Index -> a) -> [a] -> [a])
- Sequential :: (Type a, MetaType () [a], MetaType rst st) => Feldspar (In () -> In rst -> (Out () -> Out rst -> In ((), rst)) -> (Out rst -> In ()) -> Out ()) (Length -> st -> (Index -> st -> (a, st)) -> (st -> [a]) -> [a])
- ForLoop :: MetaType rst st => Feldspar (In () -> In rst -> (Out () -> Out rst -> In rst) -> Out rst) (Length -> st -> (Index -> st -> st) -> st)
- NoInline :: MetaType rb b => String -> Feldspar ((Out ra -> In rb) -> In ra -> Out rb) ((a -> b) -> a -> b)
- SetLength :: Type a => Feldspar (In () -> In () -> Out ()) (Length -> [a] -> [a])
- SetIx :: Type a => Feldspar (In () -> In () -> In () -> Out ()) (Index -> a -> [a] -> [a])
- eqLiteral :: (Typeable a, Typeable b, Eq b) => a -> b -> Bool
- sameType :: forall a b. (Typeable a, Typeable b) => a -> b -> Bool
- evalParallel :: Length -> (Index -> a) -> [a] -> [a]
- evalSequential :: Length -> st -> (Index -> st -> (a, st)) -> (st -> [a]) -> [a]
- evalForLoop :: Length -> st -> (Index -> st -> st) -> st
- evalSetLength :: Length -> [a] -> [a]
- evalSetIx :: Index -> a -> [a] -> [a]
- data EdgeSize role a = (Type a, Eq (Size a), Show (Size a)) => EdgeSize {}
- type FeldNetwork = Network EdgeSize Feldspar
- newtype Data a = Data {
- unData :: FeldNetwork (In ()) a
- class (MultiEdge a Feldspar EdgeSize, Set (Info a), Type (Internal a), MetaType (Role a) (Internal a)) => Syntactic a
- edgeType :: forall a. EdgeSize () a -> TypeRep
- dataSize :: Type a => Data a -> Size a
- dataNode :: Data a -> FeldNetwork (Out ()) a
- nodeData :: Type a => Size a -> FeldNetwork (Out ()) a -> Data a
- getInfo :: Syntactic a => a -> Info a
- resizeData :: Type a => Size a -> Data a -> Data a
- variable :: Syntactic a => Info a -> Ident -> a
- lambda :: (Syntactic a, Syntactic b) => Info a -> (a -> b) -> FeldNetwork (Out (Role a) -> In (Role b)) (Internal a -> Internal b)
- force :: Syntactic a => a -> a
- eval :: Syntactic a => a -> Internal a
- viewLiteral :: Syntactic a => a -> Maybe (Internal a)
- metaTypes :: forall a ra expr. MetaType ra a => expr (Out ra) a -> [([Int], TypeRep)]
- resTypes :: FeldNetwork ra a -> [([Int], TypeRep)]
- isMulti :: FeldNetwork ra a -> Bool
- isElem :: FeldNetwork ra a -> Bool
- isSelector :: FeldNetwork ra a -> Bool
- isArrayLit :: FeldNetwork ra a -> Bool
- isEmpty :: FeldNetwork ra a -> Bool
- feldSharing :: (Typeable ra, Typeable a) => FeldNetwork ra a -> FeldNetwork ra a
- showExprTree :: Syntactic a => a -> String
- showExprTree2 :: (Syntactic a, Syntactic b) => (a -> b) -> String
- drawExpr :: Syntactic a => a -> IO ()
- drawExpr2 :: (Syntactic a, Syntactic b) => (a -> b) -> IO ()
Feldspar expressions
data Feldspar role a whereSource
Feldspar-specific expressions
Literal :: (Type a, MetaType () a) => a -> Feldspar (Out ()) a | |
Function :: (Typeable (a -> b), MetaType () b) => String -> (a -> b) -> Feldspar (In ra -> Out ()) (a -> b) | |
Pair :: (Type a, Type b, MetaType () (a, b)) => Feldspar (In () -> In () -> Out ()) (a -> b -> (a, b)) | |
Condition :: MetaType ra a => Feldspar (In () -> In ra -> In ra -> Out ra) (Bool -> a -> a -> a) | |
Parallel :: (Type a, MetaType () [a]) => Feldspar (In () -> (Out () -> In ()) -> In () -> Out ()) (Length -> (Index -> a) -> [a] -> [a]) | |
Sequential :: (Type a, MetaType () [a], MetaType rst st) => Feldspar (In () -> In rst -> (Out () -> Out rst -> In ((), rst)) -> (Out rst -> In ()) -> Out ()) (Length -> st -> (Index -> st -> (a, st)) -> (st -> [a]) -> [a]) | |
ForLoop :: MetaType rst st => Feldspar (In () -> In rst -> (Out () -> Out rst -> In rst) -> Out rst) (Length -> st -> (Index -> st -> st) -> st) | |
NoInline :: MetaType rb b => String -> Feldspar ((Out ra -> In rb) -> In ra -> Out rb) ((a -> b) -> a -> b) | |
SetLength :: Type a => Feldspar (In () -> In () -> Out ()) (Length -> [a] -> [a]) | |
SetIx :: Type a => Feldspar (In () -> In () -> In () -> Out ()) (Index -> a -> [a] -> [a]) |
evalParallel :: Length -> (Index -> a) -> [a] -> [a]Source
evalSequential :: Length -> st -> (Index -> st -> (a, st)) -> (st -> [a]) -> [a]Source
evalForLoop :: Length -> st -> (Index -> st -> st) -> stSource
evalSetLength :: Length -> [a] -> [a]Source
Feldspar networks
A wrapper around Size
to make it look like an expression. The Type
constraint ensures that edges in a FeldNetwork
always have supported types.
ExprShow EdgeSize | |
Type a => MultiEdge (Data a) Feldspar EdgeSize | |
(Role a ~ (), Info a ~ EdgeSize () (Internal a), Syntactic a) => MultiEdge (Vector a) Feldspar EdgeSize | |
Type a => MultiEdge (Fix a) Feldspar EdgeSize | |
Eq (Size a) => Eq (EdgeSize role a) | |
Type a => Set (EdgeSize role a) | |
Type a => MultiEdge (Data' s a) Feldspar EdgeSize |
A Feldspar program computing a value of type a
Data | |
|
Eq (Data a) | |
(Fractional' a, Floating a) => Floating (Data a) | |
Fractional' a => Fractional (Data a) | |
Numeric a => Num (Data a) | |
Show (Data a) | |
EdgeInfo (Data a) | |
Type a => Syntactic (Data a) | |
Type a => RandomAccess (Data [a]) | |
Type a => ElemWise (Data a) | |
Type a => Splittable (Data a) | |
Fixable (Data Float) | |
Type a => MultiEdge (Data a) Feldspar EdgeSize | |
Wrap (Data a) (Data a) | Basic instances to handle |
Type a => Wrap (Vector (Data a)) (Data [a]) | |
Type a => Wrap (Matrix a) (Data [[a]]) | |
Numeric a => Mul (Data a) (Matrix a) | |
Numeric a => Mul (Data a) (DVector a) | |
Numeric a => Mul (Data a) (Data a) | |
Numeric a => Mul (DVector a) (Matrix a) | |
Numeric a => Mul (DVector a) (DVector a) | |
Numeric a => Mul (DVector a) (Data a) | |
Numeric a => Mul (Matrix a) (Matrix a) | |
Numeric a => Mul (Matrix a) (DVector a) | |
Numeric a => Mul (Matrix a) (Data a) | |
Wrap t u => Wrap (Data a -> t) (Data a -> u) | |
(Wrap t u, Type a, Nat s) => Wrap (DVector a -> t) (Data' s [a] -> u) | |
(Wrap t u, Type a, Nat row, Nat col) => Wrap (Matrix a -> t) (Data' (row, col) [[a]] -> u) |
class (MultiEdge a Feldspar EdgeSize, Set (Info a), Type (Internal a), MetaType (Role a) (Internal a)) => Syntactic a Source
Type a => Syntactic (Data a) | |
(Role a ~ (), Info a ~ EdgeSize () (Internal a), Syntactic a) => Syntactic (Vector a) | |
Type a => Syntactic (Fix a) | |
(Syntactic a, Syntactic b) => Syntactic (a, b) | |
Type a => Syntactic (Data' s a) | |
(Syntactic a, Syntactic b, Syntactic c) => Syntactic (a, b, c) | |
(Syntactic a, Syntactic b, Syntactic c, Syntactic d) => Syntactic (a, b, c, d) |
lambda :: (Syntactic a, Syntactic b) => Info a -> (a -> b) -> FeldNetwork (Out (Role a) -> In (Role b)) (Internal a -> Internal b)Source
viewLiteral :: Syntactic a => a -> Maybe (Internal a)Source
Yield the value of a constant program. If the value is not known
statically, the result is Nothing
.
resTypes :: FeldNetwork ra a -> [([Int], TypeRep)]Source
List the types of the results produced by a Feldspar
expression
isMulti :: FeldNetwork ra a -> BoolSource
isElem :: FeldNetwork ra a -> BoolSource
isSelector :: FeldNetwork ra a -> BoolSource
isArrayLit :: FeldNetwork ra a -> BoolSource
isEmpty :: FeldNetwork ra a -> BoolSource
feldSharing :: (Typeable ra, Typeable a) => FeldNetwork ra a -> FeldNetwork ra aSource
showExprTree :: Syntactic a => a -> StringSource
showExprTree2 :: (Syntactic a, Syntactic b) => (a -> b) -> StringSource