Skip to content

Commit 0f01dbe

Browse files
committed
[Offload] Expand documentation with & build guide
This patch introduces essential information to the landing page of the Sphinx documentation: * Copy and translate the contents of `offload/README.md` as the project summary section * Document how to configure CMake and build the project * Document running tests * Document building the Sphinx documentation
1 parent 4127458 commit 0f01dbe

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

offload/docs/index.rst

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,109 @@
66
Welcome to Offload's documentation!
77
===================================
88

9+
Summary
10+
-------
11+
12+
The Offload subproject aims at providing tooling, runtimes, and APIs that allow
13+
users to execute code on accelerators or other "co-processors" that may or may
14+
not match the architecture of their "host". In the long run, all kinds of
15+
targets are in scope of this effort, including but not limited to: CPUs, GPUs,
16+
FPGAs, AI/ML accelerators, distributed resources, etc.
17+
18+
For OpenMP offload users, the project is ready and fully usable. The final API
19+
design is still under development. More content will show up here and on our
20+
webpage soon. In the meantime, people are encouraged to participate in our
21+
meetings (see below) and check our `development board
22+
<https://github.com/orgs/llvm/projects/24/>`_ as well as the discussions on
23+
`Discourse <https://discourse.llvm.org/tag/offload>`_.
24+
925
.. toctree::
1026
:maxdepth: 2
1127
:caption: Contents:
1228

1329
offload-api
1430

31+
Meetings
32+
--------
33+
34+
Every second Wednesday, 7:00 - 8:00am PT, starting Jan 24, 2024. Alternates
35+
with the OpenMP in LLVM meeting. `invite.ics
36+
<https://drive.google.com/file/d/1AYwKdnM01aV9Gv9k435ArEAhn7PAer7z/view?usp=sharing>`_
37+
`Meeting Minutes and Agenda
38+
<https://docs.google.com/document/d/1PAeEshxHCv22JDBCPA9GXGggLp0t7rsnD_jL04MBbzw/edit?usp=sharing>`_.
39+
40+
41+
Building
42+
--------
43+
44+
A minimal Linux build CMake configuration:
45+
46+
.. code-block:: console
47+
48+
$ cmake llvm -Bbuild \
49+
-DCMAKE_BUILD_TYPE=Release \
50+
-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lldb;lld' \
51+
-DLLVM_ENABLE_RUNTIMES='offload;openmp' \
52+
-DLLVM_BINUTILS_INCDIR=/usr/include \
53+
-DLLVM_INSTALL_GTEST=ON
54+
$ cmake --build build
55+
56+
* ``LLVM_ENABLE_RUNTIMES`` must include ``openmp`` as it is currently a
57+
dependency of ``offload`` during the initial transitional phase of the
58+
project.
59+
* ``LLVM_BINUTILS_INCDIR`` ensures that ``LLVMgold.so`` build is enabled which
60+
is necessary for ``check-offload`` testing.
61+
* ``LLVM_INSTALL_GTEST`` ensures that the unit tests can be built which is
62+
necessary for ``check-offload-unit`` testing.
63+
64+
.. hint::
65+
66+
As part of the main build an `ExternalProject
67+
<https://cmake.org/cmake/help/latest/module/ExternalProject.html>`_ will be
68+
created at ``build/runtimes/runtimes-bins`` which contains the Offload
69+
sub-build. Additional build targets are present in the sub-build which are
70+
not accessible in the LLVM build.
71+
72+
Running Tests
73+
^^^^^^^^^^^^^
74+
75+
There are two main check targets:
76+
77+
* ``check-offload`` runs the OpenMP tests, this is available in both the LLVM
78+
build as well as the sub-build.
79+
* ``check-offload-unit`` runs the Offload API unit test, this is only available
80+
in the sub-building.
81+
82+
Building Documentation
83+
^^^^^^^^^^^^^^^^^^^^^^
84+
85+
Additional CMake options are necessary to build the Sphinx documentation.
86+
Firstly, we need to ensure the Python dependencies are available, ideally using
87+
a virtual environment:
88+
89+
.. code-block:: console
90+
91+
$ python -m venv env
92+
$ source env/bin/activate
93+
$ pip install -r requirements.txt
94+
95+
Assuming we already have an existing build described above, we need to
96+
reconfigure the Offload sub-build, this will enable the ``doc-offload-html``
97+
target.
98+
99+
.. code-block:: console
100+
101+
$ cmake runtimes -Bbuild/runtimes/runtimes-bins \
102+
-DLLVM_ENABLE_SPHINX:BOOL=ON
103+
$ cmake --build build
104+
105+
Once the documentation is built it can be viewed on `localhost:8000
106+
<http://localhost:8000>`_ as follows:
107+
108+
.. code-block:: console
109+
110+
$ cd build/runtimes/runtimes-bins/offload/docs/html
111+
$ python -m http.server
15112
16113
Indices and tables
17114
==================

0 commit comments

Comments
 (0)