diff --git a/hpvm/docs/components/index.rst b/hpvm/docs/components/index.rst index 8f9ab42a8dbf6ad461ea93867c6e6537ce79762b..d0da3e469df9a7feeadd5b9bffd9027e1f9c3405 100644 --- a/hpvm/docs/components/index.rst +++ b/hpvm/docs/components/index.rst @@ -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, 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. In addition, there are: diff --git a/hpvm/docs/references/compilation-process.rst b/hpvm/docs/developerdocs/compilation-process.rst similarity index 100% rename from hpvm/docs/references/compilation-process.rst rename to hpvm/docs/developerdocs/compilation-process.rst diff --git a/hpvm/docs/developerdocs/index.rst b/hpvm/docs/developerdocs/index.rst index 225fbdfd49eb4c143545ecf1e677b5857cb2cb99..38c8c514199a7da028dc70668fa491b22424040e 100644 --- a/hpvm/docs/developerdocs/index.rst +++ b/hpvm/docs/developerdocs/index.rst @@ -6,4 +6,6 @@ Developer Documents approximation-implementation cnn-models + compilation-process configuration-format + port-to-hpvm-c diff --git a/hpvm/docs/developerdocs/port-to-hpvm-c.rst b/hpvm/docs/developerdocs/port-to-hpvm-c.rst new file mode 100644 index 0000000000000000000000000000000000000000..dbdb900b8a8b21ee95a92370cd18eaa3028c40c9 --- /dev/null +++ b/hpvm/docs/developerdocs/port-to-hpvm-c.rst @@ -0,0 +1,30 @@ +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. diff --git a/hpvm/docs/index.rst b/hpvm/docs/index.rst index 8bf0744c50768af3dc2541a7d556976831268c36..e964b84b33265427e929b2c3ee65d3d01d4842c9 100644 --- a/hpvm/docs/index.rst +++ b/hpvm/docs/index.rst @@ -52,7 +52,7 @@ Documentation getting-started tests components/index - references/index + specifications/index developerdocs/index Indices and tables diff --git a/hpvm/docs/references/index.rst b/hpvm/docs/references/index.rst deleted file mode 100644 index e2650fb9e2b6729f514120b289f0f1dfd0a54b76..0000000000000000000000000000000000000000 --- a/hpvm/docs/references/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -References -============ - -Below are some technical details of HPVM system and the HPVM-C language. - -.. toctree:: - :maxdepth: 1 - - hpvm-c - hpvm-specification - compilation-process diff --git a/hpvm/docs/references/hpvm-c.rst b/hpvm/docs/specifications/hpvm-c-spec.rst similarity index 81% rename from hpvm/docs/references/hpvm-c.rst rename to hpvm/docs/specifications/hpvm-c-spec.rst index 8956bf0c87118ff37e3c2020d94138cfd9b03c29..ee2b55a4961c2eb2eda947e9a0c6bce6a7a292ee 100644 --- a/hpvm/docs/references/hpvm-c.rst +++ b/hpvm/docs/specifications/hpvm-c-spec.rst @@ -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>` 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. diff --git a/hpvm/docs/references/hpvm-specification.rst b/hpvm/docs/specifications/hpvm-spec.rst similarity index 100% rename from hpvm/docs/references/hpvm-specification.rst rename to hpvm/docs/specifications/hpvm-spec.rst diff --git a/hpvm/docs/specifications/index.rst b/hpvm/docs/specifications/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..bcd6199fc9341f9ec5d0e861bde52ce077865859 --- /dev/null +++ b/hpvm/docs/specifications/index.rst @@ -0,0 +1,10 @@ +Specifications +============== + +Below are the specifications of HPVM Graph Abstraction and the HPVM-C language. + +.. toctree:: + :maxdepth: 1 + + hpvm-spec + hpvm-c-spec