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

Safe HaskellSafe-Infered

Language.Paraiso.OM.Builder

Description

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

Synopsis

Documentation

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

The Builder monad is used to build Kernels.

data BuilderState vector gauge anot Source

Constructors

BuilderState 

Fields

setup :: Setup vector gauge anot
 
context :: BuilderContext anot
 
target :: Graph vector gauge anot
 

Instances

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

you can convert GHC floating point immediates to Builder.

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

you can convert GHC numeric immediates to Builder.

Show (Builder v g a ret) 
(TRealm r, Typeable c) => C (Builder v g a (Value r c))

choose the larger or the smaller of the two.

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

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

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

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

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

Builder is Ring C. You can use div and mod.

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

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

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

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

TRealm r => Boolean (Builder v g a (Value r Bool))

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

type BuilderOf r c = forall v g a. Builder v g a (Value r c)Source

buildKernelSource

Arguments

:: Setup v g a

The Orthotope machine setup.

-> Name

The name of the kernel.

-> Builder v g a ()

The builder monad.

-> Kernel v g a

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

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

The Name of the static value to store.

-> Builder v g a (Value r c)

The Value to be stored.

-> Builder v g a ()

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

:: Typeable c 
=> Operator

The reduction Operator.

-> Builder v g a (Value TLocal c)

The TLocal Value to be reduced.

-> Builder v g a (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

:: Typeable c 
=> Builder v g a (Value TGlobal c)

The TGlobal Value to be broadcasted.

-> Builder v g a (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

:: Typeable c 
=> v g

The amount of shift

-> Builder v g a (Value TLocal c)

The TLocal Value to be shifted

-> Builder v g a (Value TLocal c)

The shifted TLocal Value as a result.

Shift a TLocal Value with a constant vector.

loadIndexSource

Arguments

:: Typeable c 
=> c

The content type.

-> Axis v

The axis for which index is required

-> Builder v g a (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.

loadSizeSource

Arguments

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

The TRealm

-> c

The content type.

-> Axis v

The axis for which the size is required

-> Builder v g a (Value r c)

The TGlobal Value that contains the size of the mesh in that direction.

Load the Axis component of the mesh size, to either a TGlobal Value or TLocal Value..

annotate :: (TRealm r, Typeable c) => (a -> a) -> Builder v g a (Value r c) -> Builder v g a (Value r c)Source

Execute the builder, and annotate the very result with the givin function.

(<?>) :: (TRealm r, Typeable c) => (a -> a) -> Builder v g a (Value r c) -> Builder v g a (Value r c)Source

(?) = annotate

withAnnotation :: (a -> a) -> Builder v g a ret -> Builder v g a retSource

Execute the builder under modifed annotation.