Skip to content

Commit 59272d8

Browse files
author
Alexander Batashev
authored
[SYCL][Doc] Deploy Sphinx documentation (#1406)
Signed-off-by: Alexander Batashev <[email protected]>
1 parent 568e0ad commit 59272d8

12 files changed

+157
-40
lines changed

.github/workflows/gh_pages.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ jobs:
1313
ref: sycl
1414
path: repo
1515
- name: Install deps
16-
run: sudo apt-get install -y doxygen graphviz ssh ninja-build
16+
run: |
17+
sudo apt-get install -y doxygen graphviz ssh ninja-build
18+
sudo pip3 install sphinx recommonmark sphinx_markdown_tables
1719
- name: Build Docs
1820
run: |
1921
mkdir -p $GITHUB_WORKSPACE/build
2022
cd $GITHUB_WORKSPACE/build
2123
python $GITHUB_WORKSPACE/repo/buildbot/configure.py -w $GITHUB_WORKSPACE \
2224
-s $GITHUB_WORKSPACE/repo -o $GITHUB_WORKSPACE/build -t Release --docs
2325
cmake --build . --target doxygen-sycl
26+
cmake --build . --target docs-sycl-html
2427
- name: Deploy
2528
env:
2629
SSH_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}}
@@ -32,7 +35,11 @@ jobs:
3235
ssh-add -k ~/.ssh/id_rsa
3336
git clone [email protected]:intel/llvm-docs.git docs
3437
cd $GITHUB_WORKSPACE/docs
35-
yes | \cp -rf $GITHUB_WORKSPACE/build/tools/sycl/doc/doxygen/html/* .
38+
git rm -rf .
39+
touch .nojekyll
40+
yes | \cp -rf $GITHUB_WORKSPACE/build/tools/sycl/doc/html/* .
41+
mkdir doxygen
42+
yes | \cp -rf $GITHUB_WORKSPACE/build/tools/sycl/doc/doxygen/html/* doxygen/
3643
git config --global user.name "iclsrc"
3744
git config --global user.email "[email protected]"
3845
git add .

buildbot/configure.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def do_configure(args):
2020
sycl_build_pi_cuda = 'OFF'
2121
llvm_enable_assertions = 'ON'
2222
llvm_enable_doxygen = 'OFF'
23+
llvm_enable_sphinx = 'OFF'
2324
llvm_build_shared_libs = 'OFF'
2425

2526
if platform.system() == 'Linux':
@@ -38,6 +39,7 @@ def do_configure(args):
3839

3940
if args.docs:
4041
llvm_enable_doxygen = 'ON'
42+
llvm_enable_sphinx = 'ON'
4143

4244
if args.shared_libs:
4345
llvm_build_shared_libs = 'ON'
@@ -63,6 +65,7 @@ def do_configure(args):
6365
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
6466
"-DSYCL_INCLUDE_TESTS=ON", # Explicitly include all kinds of SYCL tests.
6567
"-DLLVM_ENABLE_DOXYGEN={}".format(llvm_enable_doxygen),
68+
"-DLLVM_ENABLE_SPHINX={}".format(llvm_enable_sphinx),
6669
"-DBUILD_SHARED_LIBS={}".format(llvm_build_shared_libs),
6770
"-DSYCL_ENABLE_XPTI_TRACING=ON", # Explicitly turn on XPTI tracing
6871
llvm_dir

sycl/doc/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,11 @@ if (LLVM_ENABLE_DOXYGEN)
7777
endif()
7878
endif()
7979

80-
# TODO enable sphinx
80+
if (LLVM_ENABLE_SPHINX)
81+
include(AddSphinxTarget)
82+
if (SPHINX_FOUND)
83+
if (${SPHINX_OUTPUT_HTML})
84+
add_sphinx_target(html sycl)
85+
endif()
86+
endif()
87+
endif()

sycl/doc/EnvironmentVariables.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# Overview
1+
# Environment Variables
22

3-
This file describes environment variables that are having effect on DPC++ compiler and runtime.
3+
This document describes environment variables that are having effect on DPC++
4+
compiler and runtime.
45

5-
# Controlling DPC++ RT
6+
## Controlling DPC++ RT
67

78
**Warning:** the environment variables described in this document are used for
89
development and debugging of DPC++ compiler and runtime. Their semantics are
@@ -24,7 +25,7 @@ subject to change. Do not rely on these variables in production code.
2425
| SYCL_DEVICE_ALLOWLIST | A list of devices and their minimum driver version following the pattern: DeviceName:{{XXX}},DriverVersion:{{X.Y.Z.W}}. Also may contain PlatformName and PlatformVersion | Filter out devices that do not match the pattern specified. Regular expression can be passed and the DPC++ runtime will select only those devices which satisfy the regex. |
2526
`(*) Note: Any means this environment variable is effective when set to any non-null value.`
2627

27-
## SYCL_PRINT_EXECUTION_GRAPH Options
28+
### SYCL_PRINT_EXECUTION_GRAPH Options
2829

2930
SYCL_PRINT_EXECUTION_GRAPH can accept one or more comma separated values from the table below
3031

sycl/doc/GetStartedGuide.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Overview
1+
# Getting Started with oneAPI DPC++
22

33
The DPC++ Compiler compiles C++ and SYCL\* source files with code for both CPU
44
and a wide range of compute accelerators such as GPU and FPGA.
55

6-
# Table of contents
6+
**Table of contents**
77

88
* [Prerequisites](#prerequisites)
99
* [Create DPC++ workspace](#create-dpc-workspace)
@@ -19,7 +19,7 @@ and a wide range of compute accelerators such as GPU and FPGA.
1919
* [CUDA backend limitations](#cuda-backend-limitations)
2020
* [Find More](#find-more)
2121

22-
# Prerequisites
22+
## Prerequisites
2323

2424
* `git` - https://git-scm.com/downloads
2525
* `cmake` version 3.2 or later - http://www.cmake.org/download/
@@ -30,7 +30,7 @@ and a wide range of compute accelerators such as GPU and FPGA.
3030
* Windows: `Visual Studio` version 15.7 preview 4 or later -
3131
https://visualstudio.microsoft.com/downloads/
3232

33-
## Create DPC++ workspace
33+
### Create DPC++ workspace
3434

3535
Throughout this document `DPCPP_HOME` denotes the path to the local directory
3636
created as DPC++ workspace. It might be useful to create an environment variable
@@ -66,7 +66,7 @@ mkdir %DPCPP_HOME%\build
6666
cd %DPCPP_HOME%\build
6767
```
6868

69-
# Build DPC++ toolchain
69+
## Build DPC++ toolchain
7070

7171
The easiest way to get started is to use the buildbot [configure](../../buildbot/configure.py)
7272
and [compile](../../buildbot/configure.py) scripts.
@@ -104,7 +104,7 @@ For more, see [opencl-aot documentation](../../opencl-aot/README.md).
104104

105105
TODO: add instructions how to deploy built DPC++ toolchain.
106106

107-
## Build DPC++ toolchain with libc++ library
107+
### Build DPC++ toolchain with libc++ library
108108

109109
There is experimental support for building and linking DPC++ runtime with
110110
libc++ library instead of libstdc++. To enable it the following CMake options
@@ -117,7 +117,7 @@ should be used.
117117
-DSYCL_LIBCXX_LIBRARY_PATH=<path to libc++ and libc++abi libraries>
118118
```
119119

120-
## Build DPC++ toolchain with support for NVIDIA CUDA
120+
### Build DPC++ toolchain with support for NVIDIA CUDA
121121

122122
There is experimental support for DPC++ for CUDA devices.
123123

@@ -133,9 +133,9 @@ Currently, the only combination tested is Ubuntu 18.04 with CUDA 10.2 using
133133
a Titan RTX GPU (SM 71), but it should work on any GPU compatible with SM 50 or
134134
above.
135135

136-
# Use DPC++ toolchain
136+
## Use DPC++ toolchain
137137

138-
## Using the DPC++ toolchain on CUDA platforms
138+
### Using the DPC++ toolchain on CUDA platforms
139139

140140
The DPC++ toolchain support on CUDA platforms is still in an experimental phase.
141141
Currently, the DPC++ toolchain relies on having a recent OpenCL implementation
@@ -153,7 +153,7 @@ Instead of installing the low level CPU runtime, it is possible to build and
153153
install the [Khronos ICD loader](https://github.com/KhronosGroup/OpenCL-ICD-Loader),
154154
which contains all the symbols required.
155155

156-
## Install low level runtime
156+
### Install low level runtime
157157

158158
To run DPC++ applications on OpenCL devices, OpenCL implementation(s) must be
159159
present in the system.
@@ -251,9 +251,9 @@ command:
251251
c:\oclcpu_rt_<cpu_version>\install.bat c:\tbb_<tbb_version>\tbb\bin\intel64\vc14
252252
```
253253

254-
## Test DPC++ toolchain
254+
### Test DPC++ toolchain
255255

256-
### Run regression tests
256+
#### Run regression tests
257257

258258
To verify that built DPC++ toolchain is working correctly, run:
259259

@@ -273,7 +273,7 @@ skipped.
273273
If CUDA support has been built, it is tested only if there are CUDA devices
274274
available.
275275

276-
### Run Khronos\* SYCL\* conformance test suite (optional)
276+
#### Run Khronos\* SYCL\* conformance test suite (optional)
277277

278278
Khronos\* SYCL\* conformance test suite (CTS) is intended to validate
279279
implementation conformance to Khronos\* SYCL\* specification. DPC++ compiler is
@@ -313,7 +313,7 @@ command:
313313
After CMake cache is generated, build the documentation with `doxygen-sycl`
314314
target. It will be put to `/path/to/build/tools/sycl/doc/html` directory.
315315

316-
## Run simple DPC++ application
316+
### Run simple DPC++ application
317317

318318
A simple DPC++ or SYCL\* program consists of following parts:
319319
1. Header section
@@ -442,7 +442,7 @@ selectors (e.g. `cl::sycl::cpu_selector`, `cl::sycl::gpu_selector`,
442442
explained in following section [Code the program for a specific
443443
GPU](#code-the-program-for-a-specific-gpu).
444444

445-
## Code the program for a specific GPU
445+
### Code the program for a specific GPU
446446

447447
To specify OpenCL device SYCL provides the abstract `cl::sycl::device_selector`
448448
class which the can be used to define how the runtime should select the best
@@ -506,11 +506,11 @@ class CUDASelector : public cl::sycl::device_selector {
506506
};
507507
```
508508

509-
# C++ standard
509+
## C++ standard
510510

511511
- Minimal supported C++ standard is C++11 on Linux and C++14 on Windows.
512512

513-
# Known Issues and Limitations
513+
## Known Issues and Limitations
514514

515515
- DPC++ device compiler fails if the same kernel was used in different
516516
translation units.
@@ -521,15 +521,15 @@ class CUDASelector : public cl::sycl::device_selector {
521521
- On Windows linking DPC++ applications with `/MTd` flag is known to cause
522522
crashes.
523523

524-
## CUDA back-end limitations
524+
### CUDA back-end limitations
525525

526526
- Backend is only supported on Linux
527527
- The only combination tested is Ubuntu 18.04 with CUDA 10.2 using a Titan RTX
528528
GPU (SM 71), but it should work on any GPU compatible with SM 50 or above
529529
- The NVIDIA OpenCL headers conflict with the OpenCL headers required for this
530530
project and may cause compilation issues on some platforms
531531

532-
# Find More
532+
## Find More
533533

534534
DPC++ specification:
535535
[https://spec.oneapi.com/versions/latest/elements/dpcpp/source/index.html](https://spec.oneapi.com/versions/latest/elements/dpcpp/source/index.html)

sycl/doc/PreprocessorMacros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Overview
1+
# Preprocessor Macros
22

33
This file describes macros that have effect on SYCL compiler and run-time.
44

sycl/doc/UsersManual.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Overview
1+
# Users Manual
22

33
The DPC++ Compiler contains many options to generate the desired binaries for
44
your application.
@@ -167,7 +167,7 @@ your application.
167167

168168
Allow unnamed SYCL lambda kernels.
169169

170-
# SYCL device code compilation
170+
## SYCL device code compilation
171171

172172
To invoke SYCL device compiler set `-fsycl-device-only` flag.
173173

@@ -183,18 +183,18 @@ By default the output format for SYCL device is LLVM bytecode.
183183
$ clang++ -fsycl-device-only -fno-sycl-use-bitcode sycl-app.cpp -o sycl-app.spv
184184
```
185185

186-
# Static archives with SYCL device code
186+
## Static archives with SYCL device code
187187

188188
The DPC++ Compiler contains support to create and use static archives that
189189
contain device enabled fat objects.
190190

191-
## Build your objects
191+
### Build your objects
192192

193193
```console
194194
$ clang++ -fsycl sycl-app1.cpp sycl-app2.cpp -c
195195
```
196196

197-
## Create the static archive
197+
### Create the static archive
198198

199199
Build the static archive in the same manner as you would any other normal
200200
static archive, using the objects that were created using the above step.
@@ -203,7 +203,7 @@ static archive, using the objects that were created using the above step.
203203
$ ar cr libsyclapp.a sycl-app1.o sycl-app2.o
204204
```
205205

206-
## Use the static archive
206+
### Use the static archive
207207

208208
Once you have created the archive, you can use it when creating your final
209209
application. The fat archives are treated differently than a regular archive

sycl/doc/conf.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
import datetime
18+
19+
# -- Project information -----------------------------------------------------
20+
21+
now = datetime.datetime.now()
22+
23+
project = 'oneAPI DPC++ Compiler'
24+
copyright = str(now.year) + ', Intel Corporation'
25+
author = 'Intel Corporation'
26+
27+
# -- General configuration ---------------------------------------------------
28+
29+
master_doc = 'contents'
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = [
35+
'sphinx_markdown_tables'
36+
]
37+
38+
# The name of the Pygments (syntax highlighting) style to use.
39+
pygments_style = 'friendly'
40+
41+
# The theme to use for HTML and HTML Help pages. See the documentation for
42+
# a list of builtin themes.
43+
html_theme = 'haiku'
44+
45+
# The suffix of source filenames.
46+
source_suffix = ['.rst', '.md']
47+
48+
# Extensions are mostly in asciidoc which has poor support in Sphinx
49+
exclude_patterns = ['extensions/*']
50+
51+
source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'}
52+
53+
def on_missing_reference(app, env, node, contnode):
54+
if node['reftype'] == 'any':
55+
return contnode
56+
else:
57+
return None
58+
59+
def setup(app):
60+
app.connect('missing-reference', on_missing_reference)

sycl/doc/contents.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Data Parallel C++ Documentation
2+
===============================
3+
4+
Using oneAPI DPC++ for Application Development
5+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6+
7+
.. toctree::
8+
:maxdepth: 1
9+
10+
GetStartedGuide
11+
UsersManual
12+
PreprocessorMacros
13+
cuda/contents
14+
Extensions <https://github.com/intel/llvm/tree/sycl/sycl/doc/extensions>
15+
FAQ
16+
17+
Developing oneAPI DPC++ Compiler
18+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19+
20+
.. toctree::
21+
:maxdepth: 1
22+
23+
API Reference <https://intel.github.io/llvm-docs/doxygen>
24+
CompilerAndRuntimeDesign
25+
EnvironmentVariables
26+
PluginInterface
27+

sycl/doc/cuda/contents.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Experimental CUDA backend for DPC++
2+
===================================
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
cuda-vs-opencl-math-builtin-precisions
8+
opencl-subgroup-vs-cuda-crosslane-op

0 commit comments

Comments
 (0)