Skip to content
Snippets Groups Projects
Commit 4a97485a authored by Yifan Zhao's avatar Yifan Zhao
Browse files

'References' -> 'Specifications'; also moved some to developer docs

parent ecb1b5e0
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ HPVM consists of a few relatively independent key components. ...@@ -7,7 +7,7 @@ HPVM consists of a few relatively independent key components.
* HPVM code generator: a few ``opt`` passes that lowers HPVM IR to LLVM IR, * HPVM code generator: a few ``opt`` passes that lowers HPVM IR to LLVM IR,
which is then compiled into object code and binary. which is then compiled into object code and binary.
:doc:`Compilation process of HPVM </references/hpvm-specification>` :doc:`Compilation process of HPVM </specifications/hpvm-spec>`
shows how these 2 components work together. shows how these 2 components work together.
In addition, there are: In addition, there are:
......
...@@ -6,4 +6,6 @@ Developer Documents ...@@ -6,4 +6,6 @@ Developer Documents
approximation-implementation approximation-implementation
cnn-models cnn-models
compilation-process
configuration-format configuration-format
port-to-hpvm-c
Porting a Program from C to HPVM-C
==================================
The following represents the required steps to port a regular C program into an HPVM program with HPVM-C. These steps are described at a high level; for more detail, please see `hpvm-cava </hpvm/test/benchmarks/hpvm-cava>`_ provided in `benchmarks </hpvm/test/benchmarks>`_.
* Separate the computation that will become a kernel into its own (leaf node) function and add the attributes and target hint.
* Create a level 1 wrapper node function that will describe the thread-level parallelism (for the GPU). The node will:
* Use the ``createNode[ND]()`` method to create a kernel node and specify how many threads will execute it.
* Bind its arguments to the kernel arguments.
* If desired, create a level 2 wrapper node function which will describe the threadblock-level parallalism (for the GPU). This node will:
* Use the ``createNode[ND]()`` method to create a level 1 wrapper node and specify how many threadblocks will execute it.
* Bind its arguments to its child node's arguments.
* A root node function that creates all the top-level wrapper nodes, binds their arguments, and connects their edges.
* Each root node represents a DFG.
* All the above node functions have the combined arguments of all the kernels that are nested at each level.
* The host code will have to include the following:
* Initialize the HPVM runtime using the ``init()`` method.
* Create an argument struct for each DFG and assign its member variables.
* Add all the memory that is required by the kernel into the memory tracker.
* Launch the DFG by calling the ``launch()`` method on the root node function, and passing the corresponding argument struct.
* Wait for the DFG to complete execution.
* Read out any generated memory using the ``request_mem()`` method.
* Remove all the tracked memory from the memory tracker.
...@@ -52,7 +52,7 @@ Documentation ...@@ -52,7 +52,7 @@ Documentation
getting-started getting-started
tests tests
components/index components/index
references/index specifications/index
developerdocs/index developerdocs/index
Indices and tables Indices and tables
......
References
============
Below are some technical details of HPVM system and the HPVM-C language.
.. toctree::
:maxdepth: 1
hpvm-c
hpvm-specification
compilation-process
...@@ -117,35 +117,3 @@ Atomically computes the bitwise XOR of ``v`` and the value stored at memory loca ...@@ -117,35 +117,3 @@ Atomically computes the bitwise XOR of ``v`` and the value stored at memory loca
``void __hpvm__barrier()``:raw-html-m2r:`<br>` ``void __hpvm__barrier()``:raw-html-m2r:`<br>`
Local synchronization barrier across dynamic instances of current leaf node. Local synchronization barrier across dynamic instances of current leaf node.
Porting a Program from C to HPVM-C
==================================
The following represents the required steps to port a regular C program into an HPVM program with HPVM-C. These steps are described at a high level; for more detail, please see `hpvm-cava </hpvm/test/benchmarks/hpvm-cava>`_ provided in `benchmarks </hpvm/test/benchmarks>`_.
* Separate the computation that will become a kernel into its own (leaf node) function and add the attributes and target hint.
* Create a level 1 wrapper node function that will describe the thread-level parallelism (for the GPU). The node will:
* Use the ``createNode[ND]()`` method to create a kernel node and specify how many threads will execute it.
* Bind its arguments to the kernel arguments.
* If desired, create a level 2 wrapper node function which will describe the threadblock-level parallalism (for the GPU). This node will:
* Use the ``createNode[ND]()`` method to create a level 1 wrapper node and specify how many threadblocks will execute it.
* Bind its arguments to its child node's arguments.
* A root node function that creates all the top-level wrapper nodes, binds their arguments, and connects their edges.
* Each root node represents a DFG.
* All the above node functions have the combined arguments of all the kernels that are nested at each level.
* The host code will have to include the following:
* Initialize the HPVM runtime using the ``init()`` method.
* Create an argument struct for each DFG and assign its member variables.
* Add all the memory that is required by the kernel into the memory tracker.
* Launch the DFG by calling the ``launch()`` method on the root node function, and passing the corresponding argument struct.
* Wait for the DFG to complete execution.
* Read out any generated memory using the ``request_mem()`` method.
* Remove all the tracked memory from the memory tracker.
Specifications
==============
Below are the specifications of HPVM Graph Abstraction and the HPVM-C language.
.. toctree::
:maxdepth: 1
hpvm-spec
hpvm-c-spec
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment