Skip to content

Commit 2f78431

Browse files
Merge branch 'master' into gold/2021
2 parents 1f7c4dd + 039f031 commit 2f78431

File tree

89 files changed

+3974
-1922
lines changed

Some content is hidden

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

89 files changed

+3974
-1922
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ jobs:
4545
uses: conda-incubator/setup-miniconda@v2
4646
with:
4747
activate-environment: dpnp
48-
python-version: 3.7
48+
python-version: 3.8
49+
channels: intel,conda-forge
4950
auto-activate-base: false
5051
- name: Conda info
5152
shell: bash -l {0}
@@ -55,22 +56,26 @@ jobs:
5556
- name: Install sphinx dependencies
5657
shell: bash -l {0}
5758
run: |
58-
conda install numpy cython sphinx sphinx_rtd_theme wheel
59+
conda install sphinx sphinx_rtd_theme
60+
- name: Install dpnp dependencies
61+
shell: bash -l {0}
62+
run: |
63+
conda install dpctl mkl-devel-dpcpp tbb-devel dpcpp_linux-64 cmake=3.19 cython pytest \
64+
-c dppy/label/dev -c intel -c conda-forge
5965
- name: Install cuPy dependencies
6066
shell: bash -l {0}
6167
run: |
6268
conda install -c conda-forge cupy cudatoolkit=10.0
6369
- name: Build library
6470
shell: bash -l {0}
6571
run: |
66-
. /opt/intel/oneapi/setvars.sh
67-
. ./scripts/install_cmake_lin.sh
68-
./0.build.sh
72+
python setup.py build_clib
73+
CC=dpcpp python setup.py build_ext --inplace
74+
python setup.py develop
6975
- name: Build docs
7076
shell: bash -l {0}
7177
run: |
72-
. /opt/intel/oneapi/setvars.sh
73-
./0.builddoc.sh
78+
make html
7479
working-directory: doc
7580
# https://github.com/marketplace/actions/doxygen-action
7681
- name: Build backend docs

.github/workflows/pre-commit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
- uses: pre-commit/action@v2.0.0

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/PyCQA/bandit
5+
rev: '1.7.0'
6+
hooks:
7+
- id: bandit
8+
pass_filenames: false
9+
args: ["-r", "dpnp", "-lll"]

1.build.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

2-
CALL "1.env.bat"
2+
:: CALL "1.env.bat"
33

44
python setup.py clean
5-
python setup.py build_clib
5+
python setup.py build_clib_setuptools
66

77
:: inplace build
88
python setup.py build_ext --inplace

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cd dpnp
2929
## Install Wheel Package from Pypi
3030
Install DPNP
3131
```cmd
32-
python -m pip install --index-url https://pypi.anaconda.org/intel/simple -extra-index-url https://pypi.org/simple dpnp
32+
python -m pip install --index-url https://pypi.anaconda.org/intel/simple --extra-index-url https://pypi.org/simple dpnp
3333
```
3434
Note: DPNP wheel package is placed on Pypi, but some of its dependencies (like Intel numpy) are in Anaconda Cloud.
3535
That is why install command requires additional intel Pypi channel from Anaconda Cloud.

conda-recipe/bld.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
2+
SET "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
3+
4+
IF DEFINED DPLROOT (
5+
ECHO "Sourcing DPLROOT"
6+
SET "INCLUDE=%DPLROOT%\include;%INCLUDE%"
7+
)
8+
9+
%PYTHON% setup.py build_clib
10+
%PYTHON% setup.py build_ext install

conda-recipe/meta.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ requirements:
88
host:
99
- python
1010
- setuptools
11-
- numpy 1.19.5
11+
- numpy 1.19
1212
- cython
1313
- cmake 3.19
1414
- dpctl >=0.10
15-
- mkl-devel-dpcpp
15+
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2021.1.1') }}
1616
- tbb-devel
1717
- wheel
1818
build:
1919
- {{ compiler('dpcpp') }}
20+
- dpcpp-cpp-rt {{ environ.get('DPCPP_VER', '>=2021.1.1') }}
2021
run:
2122
- python
2223
- dpctl >=0.10
23-
- dpcpp_cpp_rt >=2021.1.1
24-
- mkl >=2021.1.1
25-
- mkl-dpcpp >=2021.1.1
24+
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x.x') }}
25+
- {{ pin_compatible('mkl-dpcpp', min_pin='x.x', max_pin='x.x') }}
2626
- numpy >=1.15
2727

2828
build:
@@ -46,7 +46,6 @@ test:
4646
- setup.cfg
4747
commands:
4848
- python -c "import dpnp"
49-
- conda list
5049
- pytest -s
5150

5251
about:

dpnp/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@
4040
if "numpy" in sys.modules:
4141
warnings.warn("\nDPNP: Module NumPy found. Please load DPNP module before NumPy.\n")
4242

43+
44+
import os
45+
mypath = os.path.dirname(os.path.realpath(__file__))
46+
47+
import dpctl
48+
dpctlpath = os.path.dirname(dpctl.__file__)
49+
50+
os.environ["PATH"] += os.pathsep + mypath + os.pathsep + dpctlpath
51+
52+
4353
# from dpnp.dparray import dparray as ndarray
4454
from dpnp.dpnp_array import dpnp_array as ndarray
4555
from dpnp.dpnp_flatiter import flatiter as flatiter

dpnp/backend/CMakeLists.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ elseif(WIN32)
230230
# -DMKL_ILP64 -I"%MKLROOT%\include"
231231
# mkl_sycl_dll.lib mkl_intel_ilp64_dll.lib mkl_sequential_dll.lib mkl_core_dll.lib sycl.lib OpenCL.lib
232232
set(DPNP_MATHLIB_DEP_LIBS
233-
mkl_sycl # _dll
234-
mkl_intel_ilp64 # _dll
235-
mkl_sequential # _dll
236-
mkl_core # _dll
233+
mkl_sycl_dll
234+
mkl_intel_ilp64_dll
235+
mkl_tbb_thread_dll # mkl_sequential_dll
236+
mkl_core_dll
237237
sycl
238238
OpenCL
239239
CACHE STRING "Set of libraries to link")
@@ -243,11 +243,9 @@ endif()
243243

244244
target_link_libraries(dpnp_backend_c PUBLIC ${DPNP_MATHLIB_DEP_LIBS})
245245

246-
# Parallel STL from DPC++
247-
if(NOT WIN32)
248-
find_package(DPL REQUIRED)
249-
target_include_directories(dpnp_backend_c PUBLIC ${DPL_INCLUDE_DIR})
250-
endif()
246+
# Parallel STL
247+
find_package(DPL REQUIRED)
248+
target_include_directories(dpnp_backend_c PUBLIC ${DPL_INCLUDE_DIR})
251249

252250
# SYCL queue manager
253251
if(DPNP_SYCL_QUEUE_MGR_ENABLE)

dpnp/backend/examples/example10.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void test_mkl_random_normal(
7777
double dev_time_used = 0.0;
7878
double sum_dev_time_used = 0.0;
7979

80-
cl::sycl::queue queue{cl::sycl::gpu_selector()};
80+
sycl::queue queue{sycl::gpu_selector()};
8181

8282
double* result = reinterpret_cast<double*>(malloc_shared(size * sizeof(double), queue));
8383
if (result == nullptr)

0 commit comments

Comments
 (0)