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

Safe HaskellNone
LanguageHaskell2010

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) Source 
Show anot => Show (Setup vector gauge anot) Source 

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)) => Show (Kernel vector gauge anot) Source 
Nameable (Kernel v g a) Source 

type Graph vector gauge anot = Gr (Node vector gauge anot) Edge Source

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

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

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 b Source

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

getA :: Node v g a -> a Source

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) Source 
(Show anot, Show (vector gauge)) => Show (Node vector gauge anot) Source 

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.

newtype StaticIdx Source

Constructors

StaticIdx 

Fields

fromStaticIdx :: Int
 

Instances

data Inst vector gauge Source

Constructors

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

Instances

Show (vector gauge) => Show (Inst vector gauge) Source 
Arity (Inst vector gauge) Source