Paraiso-0.0.0.0: a code generator for partial differential equations solvers.

Language.Paraiso.OM.Builder

Description

A monadic library to build dataflow graphs for OM. This module just exports a set of chosen symbols from Language.Paraiso.OM.Builder.Internal.

Synopsis

Documentation

type Builder vector gauge val = State (BuilderState vector gauge) valSource

The Builder monad is used to build Kernels.

data BuilderState vector gauge Source

Constructors

BuilderState 

Fields

setup :: Setup vector gauge
 
target :: Graph vector gauge ()
 

Instances

(Show (vector gauge), C gauge, Vector vector) => Show (BuilderState vector gauge) 
Eq (Builder v g v2) 
(Vector v, C g, TRealm r, Typeable c, C c, Fractional c) => Fractional (Builder v g (Value r c))

you can convert GHC floating point immediates to Builder.

(Vector v, C g, TRealm r, Typeable c, C c) => Num (Builder v g (Value r c))

you can convert GHC numeric immediates to Builder.

Show (Builder v g v2) 
(Vector v, C g, TRealm r, Typeable c) => C (Builder v g (Value r c))

choose the larger or the smaller of the two.

(Vector v, C g, TRealm r, Typeable c, C c) => C (Builder v g (Value r c)) 
(Vector v, C g, TRealm r, Typeable c, C c) => C (Builder v g (Value r c))

Builder is Algebraic C. You can use sqrt and so on.

(Vector v, C g, TRealm r, Typeable c, C c) => C (Builder v g (Value r c))

Builder is Field C. You can use /, recip.

(Vector v, C g, TRealm r, Typeable c, C c) => C (Builder v g (Value r c)) 
(Vector v, C g, TRealm r, Typeable c, C c) => C (Builder v g (Value r c))

Builder is Ring C. You can use one, *.

(Vector v, C g, TRealm r, Typeable c) => C (Builder v g (Value r c)) 
(Vector v, C g, TRealm r, Typeable c, C c) => C (Builder v g (Value r c))

Builder is Additive C. You can use zero, +, -, negate.

(Vector v, C g, TRealm r) => Boolean (Builder v g (Value r Bool))

Builder is Boolean. You can use true, false, not, &&, ||.

type BuilderOf r c = (Vector v, C g) => Builder v g (Value r c)Source

makeKernelSource

Arguments

:: (Vector v, C g) 
=> Setup v g

The Orthotope machine setup.

-> Name

The name of the kernel.

-> Builder v g ()

The builder monad.

-> Kernel v g ()

The created kernel.

Create a Kernel from a Builder monad.

loadSource

Arguments

:: (TRealm r, Typeable c) 
=> r

The TRealm type.

-> c

The content type.

-> Name

The Name of the static value to load.

-> B (Value r c)

The loaded TLocal Value as a result.

Load from a static value.

storeSource

Arguments

:: (Vector v, C g, TRealm r, Typeable c) 
=> Name

The Name of the static value to store.

-> Builder v g (Value r c)

The Value to be stored.

-> Builder v g ()

The result.

Store to a static value.

immSource

Arguments

:: (TRealm r, Typeable c) 
=> c

A Haskell value of type c to be stored.

-> B (Value r c)

TLocal Value with the c stored.

Create an immediate Value from a Haskell concrete value. TRealm is type-inferred.

reduceSource

Arguments

:: (Vector v, C g, Typeable c) 
=> Operator

The reduction Operator.

-> Builder v g (Value TLocal c)

The TLocal Value to be reduced.

-> Builder v g (Value TGlobal c)

The TGlobal Value that holds the reduction result.

Reduce over a TLocal Value using the specified reduction Operator to make a TGlobal Value

broadcastSource

Arguments

:: (Vector v, C g, Typeable c) 
=> Builder v g (Value TGlobal c)

The TGlobal Value to be broadcasted.

-> Builder v g (Value TLocal c)

The TLocal Value, all of them containing the global value.

Broadcast a TGlobal Value to make it a TLocal Value

shiftSource

Arguments

:: (Vector v, C g, Typeable c, C (v g)) 
=> v g

The amount of shift

-> Builder v g (Value TLocal c)

The TLocal Value to be shifted

-> Builder v g (Value TLocal c)

The shifted TLocal Value as a result.

Shift a TLocal Value with a constant vector.

loadIndexSource

Arguments

:: (Vector v, C g, Typeable c) 
=> c

The content type.

-> Axis v

The axis for which index is required

-> Builder v g (Value TLocal c)

The TLocal Value that contains the address as a result.

Load the Axis component of the mesh address, to a TLocal Value.