From c162ab664e7b34d04ab1e6eb9001b5078658e4ff Mon Sep 17 00:00:00 2001
From: Kapil Kanwar <kkanwar2@illinois.edu>
Date: Thu, 23 Jan 2020 18:04:15 -0600
Subject: [PATCH] Make simple modifications to formatting of documentation

---
 hpvm/docs/hpvm-c.md             |  8 +++++---
 hpvm/docs/hpvm-specification.md | 21 ++++++++++++---------
 2 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/hpvm/docs/hpvm-c.md b/hpvm/docs/hpvm-c.md
index 25990c2230..61b61efb05 100644
--- a/hpvm/docs/hpvm-c.md
+++ b/hpvm/docs/hpvm-c.md
@@ -37,7 +37,7 @@ Pop and return data produced from one execution of streaming DFG with handle ```
 ```void* __visc__createNodeND(unsigned dims, void* F, ...)```  
 Creates a static dataflow node replicated in ```dims``` dimensions (0 to 3), each executing node function ```F```. The arguments following ```F``` are the size of each dimension, respectively, passed in as a ```size_t```. Returns a handle to the created dataflow node.
 
-```void* __visc__edge(void* src, void* dst, unsigned replType, unsigned sp, unsigned dp, unsigned stream)```  
+```void* __visc__edge(void* src, void* dst, unsigned replType, unsigned sp, unsigned dp, unsigned isStream)```  
 Creates an edge from output ```sp``` of node ```src``` to input ```dp``` of node ```dst```. If ```replType``` is 0, the edge is a one-to-one edge, otherwise it is an all-to-all edge. ```isStream``` defines whether or not the edge is streaming. Returns a handle to the created edge.
 
 ```void __visc__bindIn(void* N, unsigned ip, unsigned ic, unsigned isStream)```  
@@ -46,14 +46,16 @@ Binds the input ```ip``` of the current node to input ```ic``` of child node fun
 ```void __visc__bindOut(void* N, unsigned op, unsigned oc, unsigned isStream)```  
 Binds the output ```op``` of the current node to output ```oc``` of child node function ```N```. ```isStream``` defines whether or not the output bind is streaming.
 
-```void __visc__hint(enum Target target)``` (C\) / ```void __visc__hint(visc::Target target)``` (C++)  
+```void __visc__hint(enum Target target)``` (C\)  
+```void __visc__hint(visc::Target target)``` (C++)  
 Must be called once in each node function. Indicates which hardware target the current function should run in
 
 ```void __visc__attributes(unsigned ni, …, unsigned no, …)```  
 Must be called once at the beginning of each node function. Defines the properties of the pointer arguments to the current function. ```ni``` represents the number of input arguments, and ```no``` the number of output arguments. The arguments following ```ni``` are the input arguments, and the arguments following ```no``` are the output arguments. Arguments can be marked as both input and output. All pointer arguments must be included.
 
 ## Leaf Node API
-```void __visc__hint(enum Target target)``` (C\) / ```void __visc__hint(visc::Target target)``` (C++)  
+```void __visc__hint(enum Target target)``` (C\)  
+```void __visc__hint(visc::Target target)``` (C++)  
 As described in internal node API.
 
 ```void __visc__attributes(unsigned ni, …, unsigned no, …)```  
diff --git a/hpvm/docs/hpvm-specification.md b/hpvm/docs/hpvm-specification.md
index f5740b83e9..fdd3c28e28 100644
--- a/hpvm/docs/hpvm-specification.md
+++ b/hpvm/docs/hpvm-specification.md
@@ -2,32 +2,34 @@
 An HPVM program is a combination of host code plus a set of one or more distinct dataflow graphs. Each dataflow graph (DFG) is a hierarchical graph with side effects. Nodes represent units of execution, and edges between nodes describe the explicit data transfer requirements. A node can begin execution once a data item becomes available on every one of its input edges. Repeated transfer of data items between nodes (if more inputs are provided) yields a pipelined execution of different nodes in the graph. The execution of a DFG is initiated and terminated by host code that launches the graph. Nodes may access globally shared memory through load and store instructions (side-effects).
 
 ## Dataflow Node
-A dataflow node represents unit of computation in the DFG. A node can begin execution once a data item becomes available on every one of its input edges.
+A *dataflow node* represents unit of computation in the DFG. A node can begin execution once a data item becomes available on every one of its input edges.
 
 A single static dataflow node represents multiple dynamic instances of the node, each executing the same computation with different index values. The dynamic instances of a node are required to be independent of each other except on HPVM synchronization operations.
 
-Each dataflow node in a DFG can either be a leaf node or an internal node. An internal node contains a complete DFG, called a child graph, and the child graph itself can have internal nodes and/or leaf nodes.
+Each dataflow node in a DFG can either be a *leaf node* or an *internal node*. An internal node contains a complete DFG, called a *child graph*, and the child graph itself can have internal nodes and/or leaf nodes.
 
 Internal nodes only create the structure of the child graph, and cannot include actual computation. The DFG cannot be modified at runtime except for the number of dynamic instances, which can be data dependent.
 
 Leaf nodes contain code expressing actual computations. Leaf nodes may contain instructions to query the structure of the underlying DFG, and any non host side HPVM operation for synchronization and memory allocation.
 
 ## Dataflow Edge
-A dataflow edge from the output out of a source dataflow node ```Src``` to the input in of a sink dataflow node ```Dst``` describes the explicit data transfer requirements. ```Src``` and ```Dst``` node must belong to the same child graph, i.e. must be children of the same internal node.
+A *dataflow edge* from the output out of a source dataflow node ```Src``` to the input in of a sink dataflow node ```Dst``` describes the explicit data transfer requirements. ```Src``` and ```Dst``` node must belong to the same child graph, i.e. must be children of the same internal node.
 
 An edge from source to sink has the semantics of copying the specified data from the source to the sink after the source node has completed execution. The pairs ```(Src, out)```, and ```(Dst, in)``` must be unique, i.e. no two dataflow edges in the same graph can have the same source or destination.
 
 A static edge also represents multiple dynamic instances of that edge between the dynamic instances of the source and the sink nodes.
 
-An edge can be instantiated at runtime using one of two replication mechanisms: all-to-all, where all dynamic instances of the source node are connected to all dynamic instances of the sink node, thus expressing a synchronization barrier between the two groups of nodes, or one-to-one, where each dynamic instance of the source node is connected to a single corresponding instance of the sink node. One-to-one replication requires that the grid structure (number of dimensions and the extents in each dimension) of the source and sink nodes be identical.
+An edge can be instantiated at runtime using one of two replication mechanisms:
+- *All-to-all*, where all dynamic instances of the source node are connected to all dynamic instances of the sink node, thus expressing a synchronization barrier between the two groups of nodes, or
+- *One-to-one*, where each dynamic instance of the source node is connected to a single corresponding instance of the sink node. One-to-one replication requires that the grid structure (number of dimensions and the extents in each dimension) of the source and sink nodes be identical.
 
 ## Input and Output Bind
 An internal node is responsible for mapping its inputs, provided by incoming dataflow edges, to the inputs to one or more nodes of the child graph.
 
-An internal node binds its input ```ip``` to input ```ic``` of its child node ```Dst``` using an input bind.
+An internal node binds its input ```ip``` to input ```ic``` of its child node ```Dst``` using an *input bind*.
 The pair ```(Dst, ic)``` must be unique, i.e. no two input binds in the same graph can have the same destination, as that would create a conflict. Semantically, these represent name bindings of input values and not data movement.
 
-Conversely, an internal node binds output ```oc``` of its child node ```Src``` to its output ```op``` using an output bind. The pair ```(Src, oc)``` and destination ```op``` must be unique, i.e. no two output binds in the same graph can have the same source destination, as that would create a conflict.
+Conversely, an internal node binds output ```oc``` of its child node ```Src``` to its output ```op``` using an *output bind*. The pair ```(Src, oc)``` and destination ```op``` must be unique, i.e. no two output binds in the same graph can have the same source destination, as that would create a conflict.
 
 A bind is always all-to-all.
 
@@ -61,7 +63,7 @@ The code for each dataflow node is given as a separate LLVM function, called the
 
 The incoming dataflow edges and their data types are denoted by the parameters to the node function. The outgoing dataflow edges are represented by the return type of the node function, which must be an LLVM struct type with zero or more fields (one per outgoing edge).
 
-We represent nodes with opaque handles (pointers of LLVM type i8*). We represent input edges of a node as integer indices into the list of function arguments, and output edges of a node as integer indices into the return struct type.
+We represent nodes with opaque handles (pointers of LLVM type i8\*). We represent input edges of a node as integer indices into the list of function arguments, and output edges of a node as integer indices into the return struct type.
 
 Pointer arguments of node functions are required to be annotated with attributes in, and/or out, depending on their expected use (read only, write only, read write).
 
@@ -83,7 +85,7 @@ Create a static dataflow node replicated in two dimensions, namely ```x``` and `
 Create a static dataflow node replicated in three dimensions, namely ```x```, ```y``` and ```z```, with ```n1```, ```n2``` and ```n3``` dynamic instances in each dimension respectively, executing node function ```F```. Return a handle to the created node.
 
 ```i8* llvm.hpvm.createEdge(i8* Src, i8* Dst, i1 ReplType, i32 sp, i32 dp, i1 isStream)```  
-Create edge from output ```sp``` of node ```Src``` to input ```dp``` of node ```Dst```. ```ReplType``` chooses between a 1-1 or all-to-all edge. ```isStream``` chooses a streaming (1) or non streaming (0) edge. Return a handle to the created edge.
+Create edge from output ```sp``` of node ```Src``` to input ```dp``` of node ```Dst```. ```ReplType``` chooses between a one-to-one (0) or all-to-all (1) edge. ```isStream``` chooses a streaming (1) or non streaming (0) edge. Return a handle to the created edge.
 
 ```void llvm.hpvm.bind.input(i8* N, i32 ip, i32 ic, i1 isStream)```  
 Bind input ```ip``` of current node to input ```ic``` of child node ```N```. ```isStream``` chooses a streaming (1) or non streaming (0) bind.
@@ -115,7 +117,8 @@ Get number of dynamic instances of node ```N``` in dimension x, y or z respectiv
 The following intrinsics are used for memory allocation and synchronization. They can only be used by leaf nodes.
 
 ```i8* llvm.hpvm.malloc(i64 nBytes)```  
-Allocate a block of memory of size ```nBytes``` and return pointer to it. The allocated object can be shared by all nodes, although the pointer returned must somehow be communicated explicitly for use by other nodes.
+Allocate a block of memory of size ```nBytes``` and return pointer to it. The allocated object can be shared by all nodes.  
+*Note that the pointer returned must somehow be communicated explicitly for use by other nodes.*
 
 ```i32 llvm.hpvm.atomic.add(i8* m, i32 v)```  
 Atomically computes the bitwise ADD of ```v``` and the value stored at memory location ```[m]```. Returns the value previously stored at ```[m]```.
-- 
GitLab