Skip to content

Commit 0690d49

Browse files
Merge remote-tracking branch 'origin/master' into gold/2021
2 parents 5166e25 + 335fb23 commit 0690d49

Some content is hidden

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

52 files changed

+1231
-600
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dpctl/_version.py export-subst

.github/workflows/generate-coverage.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ jobs:
3232
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
3333
sudo apt-get install intel-oneapi-tbb
3434
35-
- name: Install CMake
35+
- name: Install CMake and Ninja
3636
run: |
37-
sudo apt-get install cmake
37+
sudo apt-get install cmake ninja-build
3838
3939
- name: Setup Python
4040
uses: actions/setup-python@v2
@@ -87,8 +87,18 @@ jobs:
8787
source /opt/intel/oneapi/setvars.sh
8888
export _SAVED_PATH=${PATH}
8989
export PATH=$(dirname $(dirname $(which icx)))/bin-llvm:${PATH}
90-
python setup.py develop -- -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx -DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON -DDPCTL_GENERATE_COVERAGE=ON -DDPCTL_BUILD_CAPI_TESTS=ON -DDPCTL_COVERAGE_REPORT_OUTPUT_DIR=$(pwd)
91-
make -C $(find _skbuild -name tests) lcov-genhtml
90+
python setup.py develop -- \
91+
-G "Ninja" \
92+
-DCMAKE_BUILD_TYPE=Debug \
93+
-DCMAKE_C_COMPILER:PATH=icx \
94+
-DCMAKE_CXX_COMPILER:PATH=icpx \
95+
-DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON \
96+
-DDPCTL_GENERATE_COVERAGE=ON \
97+
-DDPCTL_BUILD_CAPI_TESTS=ON \
98+
-DDPCTL_COVERAGE_REPORT_OUTPUT_DIR=$(pwd)
99+
pushd $(find _skbuild -name cmake-build)
100+
cmake --build . --target lcov-genhtml || exit 1
101+
popd
92102
export PATH=${_SAVED_PATH}
93103
unset _SAVED_PATH
94104
python -c "import dpctl; print(dpctl.__version__); dpctl.lsplatform()" || exit 1
@@ -98,7 +108,7 @@ jobs:
98108
shell: bash -l {0}
99109
run: |
100110
sudo gem install coveralls-lcov
101-
pip install coveralls==3.2.0
111+
pip install coveralls
102112
103113
- name: Upload coverage data to coveralls.io
104114
shell: bash -l {0}

.github/workflows/generate-docs.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
if: ${{ !github.event.pull_request || github.event.action != 'closed' }}
3636
run: |
3737
sudo apt-get install doxygen
38-
- name: Install CMake
38+
- name: Install CMake and Ninja
3939
if: ${{ !github.event.pull_request || github.event.action != 'closed' }}
4040
run: |
41-
sudo apt-get install cmake
41+
sudo apt-get install cmake ninja-build
4242
- name: Setup Python
4343
if: ${{ !github.event.pull_request || github.event.action != 'closed' }}
4444
uses: actions/setup-python@v2
@@ -55,31 +55,28 @@ jobs:
5555
with:
5656
fetch-depth: 0
5757
persist-credentials: false
58-
- name: Build dpctl
59-
if: ${{ !github.event.pull_request || github.event.action != 'closed' }}
60-
shell: bash -l {0}
61-
run: |
62-
source /opt/intel/oneapi/setvars.sh
63-
python setup.py develop -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx -DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON -DDPCTL_DPCPP_HOME_DIR=${BUILD_PREFIX}
64-
python -c "import dpctl; print(dpctl.__version__)" || exit 1
65-
- name: Build docs
58+
- name: Build dpctl+docs
6659
if: ${{ !github.event.pull_request || github.event.action != 'closed' }}
6760
shell: bash -l {0}
6861
run: |
6962
# Ensure that SYCL libraries are on LD_LIBRARY_PATH
7063
source /opt/intel/oneapi/setvars.sh
71-
cd docs
72-
mkdir -p build && cd build && rm -rf *
7364
wget https://github.com/vovkos/doxyrest/releases/download/doxyrest-2.1.2/doxyrest-2.1.2-linux-amd64.tar.xz
7465
tar xf doxyrest-2.1.2-linux-amd64.tar.xz
75-
cmake .. -DDPCTL_USE_MULTIVERSION_TEMPLATE=ON \
76-
-DDPCTL_ENABLE_DOXYREST=ON \
77-
-DDoxyrest_DIR=`pwd`/doxyrest-2.1.2-linux-amd64
78-
make Sphinx || exit 1
79-
cd ..
80-
mv generated_docs/docs ~/docs
66+
python setup.py develop -- \
67+
-G "Ninja" \
68+
-DCMAKE_BUILD_TYPE=Debug \
69+
-DCMAKE_C_COMPILER:PATH=icx \
70+
-DCMAKE_CXX_COMPILER:PATH=icpx \
71+
-DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON \
72+
-DDPCTL_GENERATE_DOCS=ON \
73+
-DDPCTL_ENABLE_DOXYREST=ON \
74+
-DDoxyrest_DIR=`pwd`/doxyrest-2.1.2-linux-amd64
75+
python -c "import dpctl; print(dpctl.__version__)" || exit 1
76+
cd "$(find _skbuild -name cmake-build)" || exit 1
77+
cmake --build . --target Sphinx || exit 1
78+
mv ../cmake-install/docs/docs ~/docs
8179
git clean -dfx
82-
cd ..
8380
- name: Publish docs
8481
if: ${{ github.ref == 'refs/heads/master' }}
8582
shell: bash -l {0}

.github/workflows/os-llvm-sycl-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- name: Install system components
6969
shell: bash -l {0}
7070
run: |
71-
sudo apt-get install cmake libtinfo5
71+
sudo apt-get install cmake ninja-build libtinfo5
7272
7373
- name: Setup Python
7474
uses: actions/setup-python@v2
@@ -97,6 +97,6 @@ jobs:
9797
export OCL_ICD_FILENAMES=libintelocl.so:libintelocl_emu.so
9898
clang++ --version
9999
sycl-ls
100-
python setup.py develop -- -G "Unix Makefiles" -DCMAKE_C_COMPILER:PATH=clang -DCMAKE_CXX_COMPILER:PATH=clang++ -DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON -DDPCTL_DPCPP_HOME_DIR=$(dirname $(dirname $(which clang))) -DDPCTL_DPCPP_FROM_ONEAPI=OFF
100+
python setup.py develop -- -G Ninja -DCMAKE_C_COMPILER:PATH=clang -DCMAKE_CXX_COMPILER:PATH=clang++ -DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON -DDPCTL_DPCPP_HOME_DIR=$(dirname $(dirname $(which clang))) -DDPCTL_DPCPP_FROM_ONEAPI=OFF
101101
python -c "import dpctl; dpctl.lsplatform()" || exit 1
102102
SYCL_ENABLE_HOST_DEVICE=1 python -m pytest -v dpctl/tests

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ add_subdirectory(libsyclinterface)
1515
file(GLOB _dpctl_capi_headers dpctl/apis/include/*.h*)
1616
install(FILES ${_dpctl_capi_headers}
1717
DESTINATION dpctl/include
18-
COMPONENT DpctlCAPIHeaders
1918
)
2019

2120
add_subdirectory(dpctl)

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
include versioneer.py
21
recursive-include dpctl/include *.h
32
include dpctl/include/dpctl4pybind11.hpp
43
recursive-include dpctl *.pxd

conda-recipe/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
export LDFLAGS="$LDFLAGS -Wl,-rpath,$PREFIX/lib"
77

88
${PYTHON} setup.py clean --all
9-
export CMAKE_GENERATOR="Unix Makefiles"
9+
export CMAKE_GENERATOR="Ninja"
1010
SKBUILD_ARGS="-- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx -DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON -DDPCTL_DPCPP_HOME_DIR=${BUILD_PREFIX}"
1111
echo "${PYTHON} setup.py install ${SKBUILD_ARGS}"
1212

conda-recipe/meta.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ requirements:
2020
- cython
2121
- cmake >=3.21
2222
- python
23-
- make # [unix]
24-
- ninja # [win]
23+
- ninja
2524
- scikit-build
2625
- numpy 1.19
2726
- wheel

docs/CMakeLists.txt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
2-
project("Data-parallel Control (dpctl)")
3-
41
# Option to generate rst for C API and add to Sphinx documentation
52
option(DPCTL_ENABLE_DOXYREST
63
"Enable generation of rst files for C API"
@@ -55,7 +52,6 @@ function(_setup_doxygen)
5552
# Target to generate only Doxygen documentation
5653
add_custom_target(
5754
Doxygen
58-
ALL
5955
DEPENDS ${DOXYGEN_INDEX_FILE}
6056
)
6157
endfunction()
@@ -95,7 +91,6 @@ function(_setup_doxyrest)
9591
# Target to generate rst from Doxygen XML using Doxyrest
9692
add_custom_target(
9793
Doxyrest
98-
ALL
9994
DEPENDS Doxygen ${DOXYREST_OUTPUT}
10095
)
10196
endfunction()
@@ -147,7 +142,6 @@ function(_setup_sphinx)
147142
# important, we want the rst files to generate prior to sphinx build.
148143
add_custom_target(
149144
Sphinx
150-
ALL
151145
DEPENDS
152146
${DEPEND_ON_DOXYREST}
153147
${DPCTL_PYAPI_RST_FILE}
@@ -196,12 +190,7 @@ if (DPCTL_ENABLE_DOXYREST)
196190
endif()
197191

198192
# Set the location where the generated docs are saved
199-
if(DPCTL_DOCGEN_PREFIX)
200-
message(STATUS "Generating dpctl documents in " ${DPCTL_DOCGEN_PREFIX})
201-
set(DOC_OUTPUT_DIR ${DPCTL_DOCGEN_PREFIX})
202-
else()
203-
set(DOC_OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/generated_docs)
204-
endif()
193+
set(DOC_OUTPUT_DIR ${CMAKE_INSTALL_PREFIX}/docs)
205194

206195
set(INDEX_NO_DOXYREST_IN ${CMAKE_CURRENT_SOURCE_DIR}/index_no_doxyrest.rst.in)
207196
set(INDEX_DOXYREST_IN ${CMAKE_CURRENT_SOURCE_DIR}/index_doxyrest.rst.in)

docs/README.md

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -32,58 +32,13 @@ sudo apt-get install liblua5.2-dev
3232
Generating the docs
3333
===================
3434

35-
The documentation should be generated using the provided `Cmake` build script.
36-
There are a few configurable options that can be used to select the type of
37-
documentation to generate.
35+
The helper script ``scripts/gen_docs.py`` is the preferred way to generate the
36+
documentation. The generated documentation html pages will be installed to the
37+
``CMAKE_INSTALL_PREFIX/docs`` directory.
3838

39-
Build only Doxygen for C API
4039
----------------------------
4140
```bash
42-
cd dpctl/docs
43-
mkdir -p build
44-
cd build
45-
cmake ..
46-
make Doxygen
41+
python scripts/gen_docs.py --doxyrest-root=<PATH to Doxyrest installation>
4742
```
48-
The above steps will generate the `Doxygen` files at
49-
`dpctl/docs/generated_docs/doxygen/html`. The documentation can also be
50-
generated at a custom location by providing the optional flag
51-
52-
```bash
53-
cd dpctl/docs
54-
mkdir -p build
55-
cd build
56-
cmake .. -DDPCTL_DOCGEN_PREFIX=<WHERE_YOU_WANT_DOCS_TO_BE_GENERATED>
57-
make Doxygen
58-
```
59-
60-
Build only Sphinx for Python API
61-
--------------------------------
62-
```bash
63-
cd dpctl/docs
64-
mkdir -p build
65-
cd build
66-
cmake .. -DDPCTL_DOCGEN_PREFIX=<WHERE_YOU_WANT_DOCS_TO_BE_GENERATED>
67-
make Sphinx
68-
```
69-
70-
The `make Sphinx` command will generate only the Python API docs for dpctl.
71-
72-
Build consolidated docs
73-
-----------------------
74-
It is possible to generate a single site with both Python and C API docs. As
75-
mentioned before, `Doxyrest` and `Lua` are required to generate the consolidated
76-
site.
77-
78-
```bash
79-
cd dpctl/docs
80-
mkdir -p build
81-
cd build
82-
cmake .. \
83-
-DDPCTL_ENABLE_DOXYREST=ON \
84-
-DDoxyrest_DIR=<PATH_TO_DOXYREST_INSTALL_DIR> \
85-
-DDPCTL_DOCGEN_PREFIX=<WHERE_YOU_WANT_DOCS_TO_BE_GENERATED>
86-
make Sphinx
87-
```
88-
The `Doxyrest_DIR` flag is optional, but is needed when Doxyrest is installed in
89-
a non-system location.
43+
To skip generating the documentation for ``libsyclinterface``, the
44+
``--doxyrest-root`` option should be omitted.

0 commit comments

Comments
 (0)