Skip to content

Commit 8ba8c27

Browse files
committed
merge from master
2 parents d17e323 + 1d5201e commit 8ba8c27

File tree

621 files changed

+68658
-2705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

621 files changed

+68658
-2705
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
11
name: CI
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
build:
7-
87
runs-on: ubuntu-latest
9-
108
container: rscohn2/oneapi-spec:latest
119
steps:
1210
- uses: actions/checkout@v2
13-
- name: build in container
11+
- name: Build
1412
env:
1513
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
1614
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
1715
run: |
1816
python3 scripts/oneapi.py spec-venv
1917
. spec-venv/bin/activate
2018
python scripts/oneapi.py --branch $GITHUB_REF ci
19+
- name: Archive site
20+
uses: actions/upload-artifact@v1
21+
with:
22+
name: oneapi-spec-artifacts
23+
path: site.zip
24+
- name: Archive spellcheck
25+
uses: actions/upload-artifact@v1
26+
with:
27+
name: spell check
28+
path: build/spelling/output.txt

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
doxygen
22
build
3+
_build
34
*~
45

56
/docker/requirements.txt
@@ -10,5 +11,6 @@ build
1011
/.vscode
1112
/site
1213
/tarballs
14+
/site.zip
1315

1416
__pycache__

.gitlab-ci-onetbb.yml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,55 @@
1-
build_tbb_spec:
1+
build_oneTBB_html:
22
stage: build
3-
tags: [python-sphinx]
3+
tags: [docker_linux]
4+
image: tr_ubuntu18.04:oneapi-spec
45
script:
5-
- sphinx-build -b html source/elements/oneTBB/source onetbb_spec
6+
- python3 -m pip install -r requirements.txt
7+
- python3 scripts/oneapi.py html source/elements/oneTBB
68
artifacts:
7-
paths: [onetbb_spec]
9+
paths: [source/elements/oneTBB/build/html]
10+
expire_in: 3d
11+
12+
build_oneTBB_pdf:
13+
stage: build
14+
tags: [docker_linux]
15+
image: tr_ubuntu18.04:oneapi-spec
16+
script:
17+
- python3 -m pip install -r requirements.txt
18+
- python3 scripts/oneapi.py latexpdf source/elements/oneTBB
19+
artifacts:
20+
paths: [source/elements/oneTBB/build/latex/*.pdf]
21+
expire_in: 3d
22+
23+
build_oneDPL_html:
24+
stage: build
25+
tags: [docker_linux]
26+
image: tr_ubuntu18.04:oneapi-spec
27+
script:
28+
- python3 -m pip install -r requirements.txt
29+
- python3 scripts/oneapi.py html source/elements/oneDPL
30+
artifacts:
31+
paths: [source/elements/oneDPL/build/html]
32+
expire_in: 3d
33+
34+
build_oneDPL_pdf:
35+
stage: build
36+
tags: [docker_linux]
37+
image: tr_ubuntu18.04:oneapi-spec
38+
script:
39+
- python3 -m pip install -r requirements.txt
40+
- python3 scripts/oneapi.py latexpdf source/elements/oneDPL
41+
artifacts:
42+
paths: [source/elements/oneDPL/build/latex/*.pdf]
843
expire_in: 3d
944

1045
pages:
1146
stage: deploy
1247
tags: [linux]
13-
needs: [build_tbb_spec]
48+
needs: [build_oneTBB_html, build_oneDPL_html]
1449
only: [develop]
1550
script:
16-
- mv onetbb_spec public
51+
- mkdir -p public
52+
- mv source/elements/oneTBB/build/html public/oneTBB
53+
- mv source/elements/oneDPL/build/html public/oneDPL
1754
artifacts:
1855
paths: [public]

README.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ oneAPI Specifications
55
.. image:: https://github.com/oneapi-src/oneapi-spec/workflows/CI/badge.svg
66
:target: https://github.com/oneapi-src/oneapi-spec/actions?query=workflow%3ACI
77

8-
This repo contains the sources for the `oneAPI Specification`_
8+
This repo contains the sources for the `oneAPI Specification`_.
99

1010
The document is built with `Sphinx`_ using a theme provided by `Read
11-
the Docs`_
11+
the Docs`_.
1212

1313
---------------------------------
14-
Editing with Github Web Interface
14+
Editing with GitHub Web Interface
1515
---------------------------------
1616

17-
The simplest and quickest way to edit is directly in the github web
17+
The simplest and quickest way to edit is directly in the GitHub web
1818
interface. It has an editor, previewer, and lets you commit
1919
changes. You won't need to install any local tools. The previewer
2020
knows how to render RST, but not the sphinx directives so it will not
@@ -32,11 +32,11 @@ to do the same task manually.
3232
Setup
3333
-----
3434

35-
Install python 3 and doxygen (>= 1.8.17). To install on **Ubuntu**::
35+
Install Python 3 and doxygen (>= 1.8.17). To install on **Ubuntu**::
3636

3737
sudo scripts/install.sh
3838

39-
Create and activate a python virtual environment with all required tools::
39+
Create and activate a Python virtual environment with all required tools::
4040

4141
python scripts/oneapi.py spec-venv
4242
source spec-venv/bin/activate
@@ -45,12 +45,12 @@ To install directly with pip::
4545

4646
pip install -r requirements.txt
4747

48-
On windows::
48+
On Windows::
4949

5050
python scripts\oneapi.py spec-venv
5151
spec-venv\Scripts\activate
5252
53-
MKL, DAL, and Level Zero are temporarily in separate private repos. If you have access to the repos you can clone them::
53+
MKL and Level Zero are temporarily in separate private repos. If you have access to the repos, you can clone them::
5454

5555
python scripts/oneapi.py clones
5656

@@ -61,8 +61,8 @@ To build the html document::
6161

6262
python scripts/oneapi.py html
6363

64-
This will not work on windows because we are using symbolic links for
65-
the elements that are in separate repos. However, windows can build
64+
This will not work on Windows because we are using symbolic links for
65+
the elements that are in separate repos. However, Windows can build
6666
individual specs for individual elements.
6767

6868
The document is organized as a book with chapters. Each element of
@@ -91,7 +91,7 @@ examples. We may not want to try to correct them.
9191
Editing Tools
9292
-------------
9393

94-
For simple edits to individual files, you can use the github web
94+
For simple edits to individual files, you can use the GitHub web
9595
interface.
9696

9797
**Emacs** has a built-in ReST mode. It does some syntax highlighting and
@@ -125,12 +125,12 @@ You can run a docker container with::
125125
CI
126126
--
127127

128-
We use Github actions. See .github/workflows/main.yml
128+
We use GitHub actions. See `<.github/workflows/main.yml>`_
129129

130130
On every commit, the CI system builds and publishes the document to
131131
the staging server. To see the URL, look at the end of the log for the
132132
build step in the CI system. The staging server is an s3 bucket, and
133-
the access keys are managed as github action secrets. PR's based on
133+
the access keys are managed as GitHub action secrets. PR's based on
134134
forks do not have access to the keys and will not publish on the
135135
staging server.
136136

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ gitpython
88
Sphinx>=2.4.0
99
sphinx-notfound-page
1010
sphinx-rtd-theme
11+
sphinx-prompt
12+
sphinx_substitution_extensions
13+
sphinx_tabs
14+
sphinxcontrib-spelling
15+
graphviz

roadmap.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ Date Milestone
149149
- Add introduction, execution, primitive lifecycle, and programming model
150150
sections
151151

152-
- oneCCL
153-
154-
- Add initial version of API for scale-up
155-
156152
- Level Zero
157153

158154
- Switched to RST as format, using oneapi-spec as upstream repo
@@ -217,8 +213,8 @@ Date Milestone
217213

218214
- oneCCL
219215

220-
- Update page with API for scale-up
221-
- Update page with GPU programming model
216+
- Add page with API for multi-GPU
217+
- Add page with multi-GPU programming model
222218
- Extend page with collective operations
223219

224220
- Level Zero

scripts/cleanup-mkl.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from os import walk
2+
from os.path import join
3+
import re
4+
5+
r = re.compile(r'\W+:name: (return-values|include-files|note|note-1|note-2|note-3|syntax|description|input-parameters|output-parameters|example)')
6+
7+
for root, dirs, files in walk("."):
8+
for file in files:
9+
if not file.endswith(".rst"):
10+
continue
11+
p = join(root, file)
12+
print(p)
13+
in_lines = open(p).readlines()
14+
l2 = in_lines[2]
15+
dup_label = '.. _%s:\n' % l2.rstrip()
16+
print('dup_label:', dup_label)
17+
with open(p, 'w') as fout:
18+
for line in in_lines:
19+
if r.match(line) or line == dup_label:
20+
print('omitting:', line)
21+
else:
22+
fout.write(line)

scripts/install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ make install
4646
set -e
4747
popd
4848
apt-get install -y \
49+
enchant \
50+
graphviz \
51+
imagemagick \
4952
latexmk \
5053
texlive-latex-base \
5154
texlive-fonts-recommended \

scripts/oneapi.py

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
import subprocess
4343
import tarfile
4444
import venv
45+
from zipfile import ZipFile
4546

4647
sys.path.insert(0, os.path.abspath(join('source','conf')))
4748
import common_conf
4849

4950
args = None
5051

5152

52-
sphinx_opts = '-q'
5353
sphinx_build = 'sphinx-build'
5454
source_dir = 'source'
5555
build_dir = 'build'
@@ -116,13 +116,14 @@ def makedirs(path):
116116
os.makedirs(path)
117117

118118
def sphinx(root, target):
119-
os.environ['LATEXMKOPTS'] = '--silent'
120-
os.environ['LATEXOPTS'] = '-interaction=nonstopmode -halt-on-error'
119+
if not args.verbose:
120+
os.environ['LATEXMKOPTS'] = '--silent'
121+
os.environ['LATEXOPTS'] = '-interaction=nonstopmode -halt-on-error'
121122
shell('%s -M %s %s %s %s' % (sphinx_build,
122123
target,
123124
join(root,source_dir),
124125
join(root,build_dir),
125-
sphinx_opts))
126+
'' if args.verbose else '-q'))
126127

127128
def get_env(var):
128129
return os.environ[var] if var in os.environ else ''
@@ -151,11 +152,15 @@ def dockerpush(root, target=None):
151152
def dockerrun(root, target=None):
152153
root_only(root)
153154
shell('docker run --rm -it'
155+
' -e http_proxy=%s'
156+
' -e https_proxy=%s'
157+
' -e no_proxy=%s'
154158
' --user %s:%s'
155159
' --volume=%s:/build'
156160
' --workdir=/build'
157161
' rscohn2/oneapi-spec'
158-
% (os.getuid(), os.getgid(), os.getcwd()))
162+
% (get_env('http_proxy'), get_env('https_proxy'), get_env('no_proxy'),
163+
os.getuid(), os.getgid(), os.getcwd()))
159164

160165
@action
161166
def clean(root, target=None):
@@ -203,9 +208,16 @@ def build(root, target):
203208
@action
204209
def ci_publish(root, target=None):
205210
root_only(root)
211+
with ZipFile('site.zip', 'w') as site_zip:
212+
for r, dirs, files in os.walk('site', topdown=True):
213+
# Exclude DAL API because it is 1.7G
214+
if os.path.basename(r) == 'oneDAL':
215+
dirs = remove_elements(dirs, ['api', '_sources'])
216+
for file in files:
217+
site_zip.write(join(r, file))
206218
if not args.branch:
207219
exit('Error: --branch <branchname> is required')
208-
if 'AWS_SECRET_ACCESS_KEY' in os.environ:
220+
if 'AWS_SECRET_ACCESS_KEY' in os.environ and os.environ['AWS_SECRET_ACCESS_KEY'] != '':
209221
shell('aws s3 sync --only-show-errors --delete site s3://%s/exclude/ci/branches/%s' % (staging_host, args.branch))
210222
log('published at http://staging.spec.oneapi.com.s3-website-us-west-2.amazonaws.com/exclude/ci/branches/%s/'
211223
% (args.branch))
@@ -311,15 +323,24 @@ def purge(root, target=None):
311323
root_only(root)
312324
for (r,dirs,files) in os.walk('site', topdown=True):
313325
r = r.replace('site/','')
314-
dirs = remove_elements(dirs,['oneDAL', 'oneL0', 'oneMKL'])
326+
dirs = remove_elements(dirs,['oneL0'])
315327
for file in files:
316328
print('http://spec.oneapi.com/%s/%s' % (r, file))
317329

330+
@action
331+
def sort_words(root, target=None):
332+
with open(join('source', 'spelling_wordlist.txt')) as fin:
333+
lines = fin.readlines()
334+
with open(join('source', 'spelling_wordlist.txt'), 'w') as fout:
335+
for l in sorted(list(set(lines))):
336+
fout.write(l)
337+
318338
@action
319339
def ci(root, target=None):
320340
root_only(root)
321341
get_tarballs(root)
322342
site(root)
343+
build('.', 'spelling')
323344
if args.branch == 'publish' or args.branch == 'refs/heads/publish':
324345
stage_publish(root)
325346
else:
@@ -336,10 +357,12 @@ def ci(root, target=None):
336357
'dockerrun': dockerrun,
337358
'html': build,
338359
'latexpdf': build,
360+
'spelling': build,
339361
'prep': prep,
340362
'prod-publish': prod_publish,
341363
'purge': purge,
342364
'site': site,
365+
'sort-words': sort_words,
343366
'spec-venv': spec_venv,
344367
'stage-publish': stage_publish}
345368

@@ -352,16 +375,15 @@ def ci(root, target=None):
352375
'oneDPL',
353376
'oneDNN']
354377

355-
tarballs = ['oneMKL',
356-
'oneL0',
357-
'oneDAL']
378+
tarballs = ['oneL0']
358379

359380
def main():
360381
global args
361382
parser = argparse.ArgumentParser(description='Build oneapi spec.')
362-
parser.add_argument('action',choices=commands.keys())
383+
parser.add_argument('action',choices=commands.keys(), default='html', nargs='?')
363384
parser.add_argument('root', nargs='?', default='.')
364385
parser.add_argument('--branch')
386+
parser.add_argument('--verbose', action='store_true')
365387
parser.add_argument('--dry-run', action='store_true')
366388
args = parser.parse_args()
367389

0 commit comments

Comments
 (0)