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

Safe HaskellSafe-Infered

Language.Paraiso.OM.Graph

Description

the components for constructing Orthotope Machine data flow draph. Most components take three arguments:

vector :: * -> *
The array dimension. It is a Vector that defines the dimension of the Orthotope on which the OM operates.
gauge :: *
The array index. The combination vector gauge needs to be an instance of C if you want to perform Shift operation.
anot :: *
The annotations put on each node. If you want to use Annotation, anot needs to be an instance of Monoid.

Synopsis

Documentation

data Setup vector gauge anot Source

An OM Setup, a set of information needed before you start building a Kernel.

Constructors

Setup 

Fields

staticValues :: Vector (Named DynValue)

The list of static orthotopes (its identifier, Realm and Type carried in the form of NamedValue)

globalAnnotation :: anot

The machine-global annotations

Instances

Eq anot => Eq (Setup vector gauge anot) 
Show anot => Show (Setup vector gauge anot) 

data Kernel vector gauge anot Source

A Kernel for OM perfor a block of calculations on OM.

Constructors

Kernel 

Fields

kernelName :: Name
 
dataflow :: Graph vector gauge anot
 

Instances

(Show anot, Show (vector gauge), Vector vector) => Show (Kernel vector gauge anot) 
Nameable (Kernel v g a) 

type Graph vector gauge anot = Gr (Node vector gauge anot) EdgeSource

The dataflow graph for Orthotope Machine. anot is an additional annotation.

nmap :: (a -> b) -> Graph v g a -> Graph v g bSource

Map the Graph annotation from one type to another. Unfortunately we cannot make one data both the instances of Graph and Functor, so nmap is a standalone function.

imap :: (Node -> a -> b) -> Graph v g a -> Graph v g bSource

Map the Graph annotation from one type to another, while referring to the node indices.

getA :: Node v g a -> aSource

get annotation of the node.

data Node vector gauge anot Source

The Node for the dataflow Graph of the Orthotope machine. The dataflow graph is a 2-part graph consisting of NValue and NInst nodes.

Constructors

NValue DynValue anot

A value node. An NValue node only connects to NInst nodes. An NValue node has one and only one input edge, and has arbitrary number of output edges.

NInst (Inst vector gauge) anot

An instruction node. An NInst node only connects to NValue nodes. The number of input and output edges an NValue node has is specified by its Arity.

Instances

Functor (Node v g) 
(Show anot, Show (vector gauge), Vector vector) => Show (Node vector gauge anot) 

data Edge Source

The Edge label for the dataflow Graph. | It keeps track of the order of the arguments.

Constructors

EUnord

an unordered edge.

EOrd Int

edges where the order matters.

Instances

newtype StaticIdx Source

Constructors

StaticIdx 

Fields

fromStaticIdx :: Int
 

Instances

data Inst vector gauge Source

Constructors

Imm Dynamic 
Load StaticIdx 
Store StaticIdx 
Reduce Operator 
Broadcast 
Shift (vector gauge) 
LoadIndex (Axis vector) 
LoadSize (Axis vector) 
Arith Operator 

Instances

(Show (vector gauge), Vector vector) => Show (Inst vector gauge) 
Arity (Inst vector gauge)