Skip to content

Commit 1b30de4

Browse files
committed
Merge branch 'master' into gold/2021
2 parents 8c89ab0 + 62fa3ab commit 1b30de4

38 files changed

+1718
-957
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
- name: Build library
8686
run: |
8787
python setup.py build_clib
88-
CC=dpcpp python setup.py build_ext --inplace
88+
CC=icpx python setup.py build_ext --inplace
8989
python setup.py develop
9090
9191
- name: Build docs

.github/workflows/conda-package.yml

Lines changed: 38 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
env:
1010
PACKAGE_NAME: dpnp
1111
MODULE_NAME: dpnp
12-
CHANNELS: '-c dppy/label/dev -c intel -c defaults --override-channels'
12+
CHANNELS: '-c dppy/label/dev -c intel -c main --override-channels'
1313
TEST_SCOPE: >-
1414
test_arraycreation.py
1515
test_dparray.py
@@ -24,80 +24,24 @@ env:
2424
VER_SCRIPT2: "d = j['dpnp'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
2525

2626
jobs:
27-
build_linux:
28-
runs-on: ubuntu-latest
29-
30-
defaults:
31-
run:
32-
shell: bash -l {0}
27+
build:
28+
name: Build ['${{ matrix.os }}', python='${{ matrix.python }}']
3329

3430
strategy:
3531
matrix:
3632
python: ['3.8', '3.9']
33+
os: [ubuntu-20.04, windows-latest]
34+
include:
35+
- python: '3.10'
36+
os: ubuntu-20.04
3737

38-
env:
39-
conda-pkgs: '/home/runner/conda_pkgs_dir/'
40-
41-
steps:
42-
- name: Cancel Previous Runs
43-
uses: styfle/[email protected]
44-
with:
45-
access_token: ${{ github.token }}
46-
47-
- name: Checkout DPNP repo
48-
uses: actions/[email protected]
49-
with:
50-
fetch-depth: 0
51-
52-
- name: Setup miniconda
53-
uses: conda-incubator/[email protected]
54-
with:
55-
auto-update-conda: true
56-
python-version: ${{ matrix.python }}
57-
miniconda-version: 'latest'
58-
activate-environment: 'build'
59-
use-only-tar-bz2: true
60-
61-
- name: Store conda paths as envs
62-
run: echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/linux-64/" >> $GITHUB_ENV
63-
64-
- name: Install conda-build
65-
run: conda install conda-build
66-
67-
- name: Cache conda packages
68-
uses: actions/[email protected]
69-
env:
70-
CACHE_NUMBER: 1 # Increase to reset cache
71-
with:
72-
path: ${{ env.conda-pkgs }}
73-
key:
74-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
75-
restore-keys: |
76-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
77-
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
78-
79-
- name: Build conda package
80-
run: conda build --no-test --python ${{ matrix.python }} ${{ env.CHANNELS }} conda-recipe
81-
82-
- name: Upload artifact
83-
uses: actions/[email protected]
84-
with:
85-
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
86-
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
87-
88-
build_windows:
89-
runs-on: windows-latest
38+
runs-on: ${{ matrix.os }}
9039

9140
defaults:
9241
run:
93-
shell: cmd /C CALL {0}
94-
95-
strategy:
96-
matrix:
97-
python: ['3.8', '3.9']
42+
shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -l {0}' }}
9843

99-
env:
100-
conda-pkgs: 'C:\Users\runneradmin\conda_pkgs_dir\'
44+
continue-on-error: false
10145

10246
steps:
10347
- name: Cancel Previous Runs
@@ -119,26 +63,31 @@ jobs:
11963
activate-environment: 'build'
12064
use-only-tar-bz2: true
12165

122-
- name: Store conda paths as envs
66+
- if: matrix.os == 'ubuntu-20.04'
67+
name: Store conda paths as envs on Linux
68+
run: echo "CONDA_BLD=$CONDA_PREFIX/conda-bld/linux-64/" >> $GITHUB_ENV
69+
70+
- if: matrix.os == 'windows-latest'
71+
name: Store conda paths as envs on Win
12372
run: |
12473
@echo on
12574
(echo CONDA_BLD=%CONDA_PREFIX%\conda-bld\win-64\) >> %GITHUB_ENV%
12675
76+
- name: Install conda-build
77+
run: conda install conda-build
78+
12779
- name: Cache conda packages
12880
uses: actions/[email protected]
12981
env:
13082
CACHE_NUMBER: 1 # Increase to reset cache
13183
with:
132-
path: ${{ env.conda-pkgs }}
84+
path: ${{ env.CONDA_PKGS_DIR }}
13385
key:
13486
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-${{hashFiles('**/meta.yaml') }}
13587
restore-keys: |
13688
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
13789
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
13890
139-
- name: Install conda-build
140-
run: conda install conda-build
141-
14291
- name: Build conda package
14392
run: conda build --no-test --python ${{ matrix.python }} ${{ env.CHANNELS }} conda-recipe
14493

@@ -149,9 +98,11 @@ jobs:
14998
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.tar.bz2
15099

151100
test_linux:
152-
needs: build_linux
101+
name: Test ['${{ matrix.os }}', python='${{ matrix.python }}']
153102

154-
runs-on: ubuntu-latest
103+
needs: build
104+
105+
runs-on: ${{ matrix.os }}
155106

156107
defaults:
157108
run:
@@ -160,6 +111,8 @@ jobs:
160111
strategy:
161112
matrix:
162113
python: ['3.8', '3.9']
114+
os: [ubuntu-20.04, ubuntu-latest]
115+
163116
experimental: [false]
164117

165118
continue-on-error: ${{ matrix.experimental }}
@@ -250,7 +203,9 @@ jobs:
250203
working-directory: ${{ env.tests-path }}
251204

252205
test_windows:
253-
needs: build_windows
206+
name: Test ['windows-latest', python='${{ matrix.python }}']
207+
208+
needs: build
254209

255210
runs-on: windows-latest
256211

@@ -422,61 +377,28 @@ jobs:
422377
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
423378
working-directory: ${{ env.tests-path }}
424379

425-
upload_linux:
426-
needs: test_linux
427-
428-
if: |
429-
(github.repository == 'IntelPython/dpnp') &&
430-
(github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
431-
432-
runs-on: ubuntu-latest
380+
upload:
381+
name: Upload ['${{ matrix.os }}', python='${{ matrix.python }}']
433382

434-
defaults:
435-
run:
436-
shell: bash -l {0}
383+
needs: [test_linux, test_windows]
437384

438385
strategy:
439386
matrix:
440387
python: ['3.8', '3.9']
388+
os: [ubuntu-20.04, windows-latest]
441389

442-
steps:
443-
- name: Download artifact
444-
uses: actions/[email protected]
445-
with:
446-
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
447-
448-
- name: Setup miniconda
449-
uses: conda-incubator/[email protected]
450-
with:
451-
auto-update-conda: true
452-
python-version: ${{ matrix.python }}
453-
miniconda-version: 'latest'
454-
activate-environment: 'upload'
390+
runs-on: ${{ matrix.os }}
455391

456-
- name: Install anaconda-client
457-
run: conda install anaconda-client
458-
459-
- name: Upload
460-
run: anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.tar.bz2
461-
env:
462-
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
392+
defaults:
393+
run:
394+
shell: ${{ matrix.os == 'windows-latest' && 'cmd /C CALL {0}' || 'bash -l {0}' }}
463395

464-
upload_windows:
465-
needs: test_windows
396+
continue-on-error: false
466397

467398
if: |
468399
(github.repository == 'IntelPython/dpnp') &&
469400
(github.ref == 'refs/heads/master' || (startsWith(github.ref, 'refs/heads/release') == true) || github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
470401
471-
runs-on: windows-latest
472-
473-
defaults:
474-
run:
475-
shell: cmd /C CALL {0}
476-
477-
strategy:
478-
matrix:
479-
python: ['3.8', '3.9']
480402
steps:
481403
- name: Download artifact
482404
uses: actions/[email protected]

0.build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ python setup.py clean
1010
python setup.py build_clib
1111

1212
# inplace build
13-
CC=dpcpp python setup.py build_ext --inplace
13+
CC=icpx python setup.py build_ext --inplace
1414

1515
# development build. Root privileges needed
1616
# python setup.py develop
1717

1818
echo
1919
echo =========example3==============
20-
dpcpp -g -fPIC dpnp/backend/examples/example3.cpp -Idpnp -Idpnp/backend/include -Ldpnp -Wl,-rpath='$ORIGIN'/dpnp -ldpnp_backend_c -o example3
20+
icpx -fsycl -g -fPIC dpnp/backend/examples/example3.cpp -Idpnp -Idpnp/backend/include -Ldpnp -Wl,-rpath='$ORIGIN'/dpnp -ldpnp_backend_c -o example3
2121
# LD_DEBUG=libs,bindings,symbols ./example3
2222
./example3
2323

README.md

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,26 @@
1-
[![Build Status](https://dev.azure.com/IntelPython/dpnp/_apis/build/status/IntelPython.dpnp?branchName=master)](https://dev.azure.com/IntelPython/dpnp/_build/latest?definitionId=6&branchName=master)
1+
[![Pre-commit](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml)
2+
[![Conda package](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml)
23
[![codecov](https://codecov.io/gh/IntelPython/dpnp/branch/master/graph/badge.svg)](https://codecov.io/gh/IntelPython/dpnp)
34
[![Build Sphinx](https://github.com/IntelPython/dpnp/workflows/Build%20Sphinx/badge.svg)](https://intelpython.github.io/dpnp)
45

5-
# DPNP: NumPy Drop-In Replacement for Intel(R) XPU
6+
# DPNP - Data Parallel Extension for NumPy*
67
[API coverage summary](https://intelpython.github.io/dpnp/reference/comparison.html#summary)
78

89
[Full documentation](https://intelpython.github.io/dpnp/)
910

1011
[DPNP C++ backend documentation](https://intelpython.github.io/dpnp/backend_doc/)
1112

12-
The project contains:
13-
- Python interface with NumPy-like API
14-
- C++ library with SYCL based kernels
15-
16-
## How to run
17-
By default main CPU SYCL queue is used. To use Intel GPU please use:
18-
```bash
19-
DPNP_QUEUE_GPU=1 python examples/example1.py
20-
```
21-
2213
## Build from source:
23-
Ensure you have the following prerequisite packages installed:
14+
Ensure you have the following prerequisite packages installed:
2415

2516
- `mkl-devel-dpcpp`
2617
- `dpcpp_linux-64` or `dpcpp_win-64` (depending on your OS)
18+
- `onedpl-devel`
2719
- `tbb-devel`
2820
- `dpctl`
2921

30-
In addition, you need oneDPL installed on your system. There are two ways to do
31-
so:
32-
33-
1. Install oneAPI and run the oneDPL activation script. E.g., on linux:
34-
35-
```bash
36-
source /opt/intel/oneapi/dpl/latest/env/vars.sh
37-
```
38-
39-
2. Clone dpl from https://github.com/oneapi-src/oneDPL and set the `DPL_ROOT`
40-
environment variable to point to the `include` directory in the repository.
41-
42-
E.g., on linux
43-
44-
```bash
45-
git clone https://github.com/oneapi-src/oneDPL
46-
export DPL_ROOT=$(pwd)/oneDPL/include
47-
```
48-
4922
After these steps, `dpnp` can be built in debug mode as follows:
5023

51-
5224
```bash
5325
git clone https://github.com/IntelPython/dpnp
5426
cd dpnp

dpnp/backend/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ string(CONCAT COMMON_LINK_FLAGS
9999
"-fsycl-device-code-split=per_kernel "
100100
)
101101
if(UNIX)
102-
set(CMAKE_CXX_COMPILER "dpcpp")
102+
set(CMAKE_CXX_COMPILER "icpx")
103103
# add_compile_options(-fPIC)
104104
elseif(WIN32)
105-
set(CMAKE_CXX_COMPILER "dpcpp")
105+
set(CMAKE_CXX_COMPILER "icx")
106106
# set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld-link")
107107
# set(CMAKE_LINKER "lld-link")
108108
# include (Platform/Windows-Clang)

dpnp/backend/include/dpnp_iface_fptr.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ enum class DPNPFuncName : size_t
178178
DPNP_FN_FMOD, /**< Used in numpy.fmod() impl */
179179
DPNP_FN_FMOD_EXT, /**< Used in numpy.fmod() impl, requires extra parameters */
180180
DPNP_FN_FULL, /**< Used in numpy.full() impl */
181-
DPNP_FN_FULL_EXT, /**< Used in numpy.full() impl, requires extra parameters */
182181
DPNP_FN_FULL_LIKE, /**< Used in numpy.full_like() impl */
183-
DPNP_FN_FULL_LIKE_EXT, /**< Used in numpy.full_like() impl, requires extra parameters */
184182
DPNP_FN_HYPOT, /**< Used in numpy.hypot() impl */
185183
DPNP_FN_HYPOT_EXT, /**< Used in numpy.hypot() impl, requires extra parameters */
186184
DPNP_FN_IDENTITY, /**< Used in numpy.identity() impl */
@@ -230,9 +228,7 @@ enum class DPNPFuncName : size_t
230228
DPNP_FN_NONZERO, /**< Used in numpy.nonzero() impl */
231229
DPNP_FN_NONZERO_EXT, /**< Used in numpy.nonzero() impl, requires extra parameters */
232230
DPNP_FN_ONES, /**< Used in numpy.ones() impl */
233-
DPNP_FN_ONES_EXT, /**< Used in numpy.ones() impl, requires extra parameters */
234231
DPNP_FN_ONES_LIKE, /**< Used in numpy.ones_like() impl */
235-
DPNP_FN_ONES_LIKE_EXT, /**< Used in numpy.ones_like() impl, requires extra parameters */
236232
DPNP_FN_PARTITION, /**< Used in numpy.partition() impl */
237233
DPNP_FN_PARTITION_EXT, /**< Used in numpy.partition() impl, requires extra parameters */
238234
DPNP_FN_PLACE, /**< Used in numpy.place() impl */
@@ -375,9 +371,7 @@ enum class DPNPFuncName : size_t
375371
DPNP_FN_VAR, /**< Used in numpy.var() impl */
376372
DPNP_FN_VAR_EXT, /**< Used in numpy.var() impl, requires extra parameters */
377373
DPNP_FN_ZEROS, /**< Used in numpy.zeros() impl */
378-
DPNP_FN_ZEROS_EXT, /**< Used in numpy.zeros() impl, requires extra parameters */
379374
DPNP_FN_ZEROS_LIKE, /**< Used in numpy.zeros_like() impl */
380-
DPNP_FN_ZEROS_LIKE_EXT, /**< Used in numpy.zeros_like() impl, requires extra parameters */
381375
DPNP_FN_LAST, /**< The latest element of the enumeration */
382376
};
383377

0 commit comments

Comments
 (0)