|
1 | | -.. Offload documentation master file, created by |
2 | | - sphinx-quickstart on Fri Jul 4 14:59:13 2025. |
3 | | - You can adapt this file completely to your liking, but it should at least |
4 | | - contain the root `toctree` directive. |
5 | | -
|
6 | 1 | Welcome to Offload's documentation! |
7 | 2 | =================================== |
8 | 3 |
|
9 | 4 | .. toctree:: |
10 | 5 | :maxdepth: 2 |
11 | | - :caption: Contents: |
| 6 | + :hidden: |
12 | 7 |
|
13 | 8 | offload-api |
14 | 9 |
|
| 10 | +Summary |
| 11 | +------- |
| 12 | + |
| 13 | +The Offload subproject aims at providing tooling, runtimes, and APIs that allow |
| 14 | +users to execute code on accelerators or other "co-processors" that may or may |
| 15 | +not match the architecture of their "host". In the long run, all kinds of |
| 16 | +targets are in scope of this effort, including but not limited to: CPUs, GPUs, |
| 17 | +FPGAs, AI/ML accelerators, distributed resources, etc. |
| 18 | + |
| 19 | +For OpenMP offload users, the project is ready and fully usable. The final API |
| 20 | +design is still under development. More content will show up here and on our |
| 21 | +webpage soon. In the meantime, people are encouraged to participate in our |
| 22 | +meetings (see below) and check our `development board |
| 23 | +<https://github.com/orgs/llvm/projects/24/>`_ as well as the discussions on |
| 24 | +`Discourse <https://discourse.llvm.org/tag/offload>`_. |
| 25 | + |
| 26 | +Meetings |
| 27 | +-------- |
| 28 | + |
| 29 | +Every second Wednesday, 7:00 - 8:00am PT, starting Jan 24, 2024. Alternates |
| 30 | +with the OpenMP in LLVM meeting. `invite.ics |
| 31 | +<https://drive.google.com/file/d/1AYwKdnM01aV9Gv9k435ArEAhn7PAer7z/view?usp=sharing>`_ |
| 32 | +`Meeting Minutes and Agenda |
| 33 | +<https://docs.google.com/document/d/1PAeEshxHCv22JDBCPA9GXGggLp0t7rsnD_jL04MBbzw/edit?usp=sharing>`_. |
| 34 | + |
| 35 | + |
| 36 | +Building |
| 37 | +-------- |
| 38 | + |
| 39 | +A minimal Linux build CMake configuration: |
| 40 | + |
| 41 | +.. code-block:: console |
| 42 | +
|
| 43 | + $ cmake llvm -Bbuild \ |
| 44 | + -DCMAKE_BUILD_TYPE=Release \ |
| 45 | + -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lldb;lld' \ |
| 46 | + -DLLVM_ENABLE_RUNTIMES='offload;openmp' |
| 47 | + $ cmake --build build |
| 48 | +
|
| 49 | +* ``LLVM_ENABLE_RUNTIMES`` must include ``openmp`` as it is currently a |
| 50 | + dependency of ``offload`` during the initial transitional phase of the |
| 51 | + project. |
| 52 | + |
| 53 | +.. hint:: |
| 54 | + |
| 55 | + As part of the main build an `ExternalProject |
| 56 | + <https://cmake.org/cmake/help/latest/module/ExternalProject.html>`_ will be |
| 57 | + created at ``build/runtimes/runtimes-bins`` which contains the Offload |
| 58 | + sub-build. Additional build targets are present in the sub-build which are |
| 59 | + not accessible in the LLVM build. |
| 60 | + |
| 61 | +Running Tests |
| 62 | +^^^^^^^^^^^^^ |
| 63 | + |
| 64 | +There are two main check targets: |
| 65 | + |
| 66 | +* ``check-offload`` runs the OpenMP tests, this is available in both the LLVM |
| 67 | + build directory as well as the runtimes-bin sub-build directory. |
| 68 | +* ``check-offload-unit`` runs the Offload API unit test, this is only available |
| 69 | + in the runtimes-bin sub-build directory. |
| 70 | + |
| 71 | +Building Documentation |
| 72 | +^^^^^^^^^^^^^^^^^^^^^^ |
| 73 | + |
| 74 | +Additional CMake options are necessary to build the Sphinx documentation. |
| 75 | +Firstly, we need to ensure the Python dependencies are available, ideally using |
| 76 | +a virtual environment: |
| 77 | + |
| 78 | +.. code-block:: console |
| 79 | +
|
| 80 | + $ python -m venv env |
| 81 | + $ source env/bin/activate |
| 82 | + $ pip install -r llvm/docs/requirements.txt |
| 83 | +
|
| 84 | +Assuming we already have an existing build described above, we need to |
| 85 | +reconfigure the Offload sub-build, this will enable the ``docs-offload-html`` |
| 86 | +target. |
| 87 | + |
| 88 | +.. code-block:: console |
| 89 | +
|
| 90 | + $ cmake runtimes -Bbuild/runtimes/runtimes-bins \ |
| 91 | + -DLLVM_ENABLE_SPHINX=ON |
| 92 | + $ cmake --build build |
| 93 | +
|
| 94 | +Once the documentation is built it can be viewed on `localhost:8000 |
| 95 | +<http://localhost:8000>`_ as follows: |
| 96 | + |
| 97 | +.. code-block:: console |
| 98 | +
|
| 99 | + $ cd build/runtimes/runtimes-bins/offload/docs/html |
| 100 | + $ python -m http.server |
15 | 101 |
|
16 | 102 | Indices and tables |
17 | 103 | ================== |
|
0 commit comments