feldspar-language-0.2: A functional embedded language for DSP and parallelism

Feldspar.Core.Functions

Contents

Description

Primitive and helper functions supported by Feldspar

Synopsis

Misc.

noSizeProp2 :: a -> b -> ()Source

(==) :: Storable a => Data a -> Data a -> Data BoolSource

(/=) :: Storable a => Data a -> Data a -> Data BoolSource

(<) :: Storable a => Data a -> Data a -> Data BoolSource

(>) :: Storable a => Data a -> Data a -> Data BoolSource

(<=) :: Storable a => Data a -> Data a -> Data BoolSource

(>=) :: Storable a => Data a -> Data a -> Data BoolSource

(?) :: Computable a => Data Bool -> (a, a) -> aSource

Selects the elements of the pair depending on the condition

(&&*) :: Computable a => (a -> Data Bool) -> (a -> Data Bool) -> a -> Data BoolSource

Lazy conjunction, second argument only run if necessary

(||*) :: Computable a => (a -> Data Bool) -> (a -> Data Bool) -> a -> Data BoolSource

Lazy disjunction, second argument only run if necessary

min :: Storable a => Data a -> Data a -> Data aSource

max :: Storable a => Data a -> Data a -> Data aSource

Loops

for :: Computable a => Data Int -> Data Int -> a -> (Data Int -> a -> a) -> aSource

For-loop

for start end init body:

  • start/end are the start/end indexes.
  • init is the starting state.
  • body computes the next state given the current loop index (ranging over [start .. end]) and the current state.

unfoldCore :: (Computable state, Storable a) => Data Length -> state -> (Data Int -> state -> (Data a, state)) -> (Data [a], state)Source

A sequential "unfolding" of an vector

unfoldCore l init step:

  • l is the length of the resulting vector.
  • init is the initial state.
  • step is a function computing a new element and the next state from the current index and current state. The index is the position of the new element in the output vector.

Bit manipulation

class (Bits a, Storable a) => Bits a whereSource

The following class provides functions for bit level manipulation

Instances