Skip to content

Commit cf1f2a2

Browse files
Merge branch 'master' of https://github.com/IntelPython/dpnp into noncentral_chisquare
2 parents 0d1b224 + de75097 commit cf1f2a2

21 files changed

+519
-117
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/[email protected]

.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"]

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

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: 4 additions & 4 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_sequential_dll
236+
mkl_core_dll
237237
sycl
238238
OpenCL
239239
CACHE STRING "Set of libraries to link")

dpnp/backend/include/dpnp_gen_2arg_3type_tbl.hpp

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,39 @@
4747
/** */ \
4848
/** Function "__name__" executes operator "__operation1__" over corresponding elements of input arrays */ \
4949
/** */ \
50-
/** @param[in] array1 Input array 1. */ \
51-
/** @param[in] array2 Input array 2. */ \
52-
/** @param[out] result1 Output array. */ \
53-
/** @param[in] size Number of elements in the output array. */ \
50+
/** @param[out] result_out Output array. */ \
51+
/** @param[in] result_size Output array size. */ \
52+
/** @param[in] result_ndim Number of output array dimensions. */ \
53+
/** @param[in] result_shape Output array shape. */ \
54+
/** @param[in] result_strides Output array strides. */ \
55+
/** @param[in] input1_in Input array 1. */ \
56+
/** @param[in] input1_size Input array 1 size. */ \
57+
/** @param[in] input1_ndim Number of input array 1 dimensions. */ \
58+
/** @param[in] input1_shape Input array 1 shape. */ \
59+
/** @param[in] input1_strides Input array 1 strides. */ \
60+
/** @param[in] input2_in Input array 2. */ \
61+
/** @param[in] input2_size Input array 2 size. */ \
62+
/** @param[in] input2_ndim Number of input array 2 dimensions. */ \
63+
/** @param[in] input2_shape Input array 2 shape. */ \
64+
/** @param[in] input2_strides Input array 2 strides. */ \
65+
/** @param[in] where Where condition. */ \
5466
template <typename _DataType_input1, typename _DataType_input2, typename _DataType_output> \
55-
void __name__(void* array1, void* array2, void* result1, size_t size);
67+
void __name__(void* result_out, \
68+
const size_t result_size, \
69+
const size_t result_ndim, \
70+
const size_t* result_shape, \
71+
const size_t* result_strides, \
72+
const void* input1_in, \
73+
const size_t input1_size, \
74+
const size_t input1_ndim, \
75+
const size_t* input1_shape, \
76+
const size_t* input1_strides, \
77+
const void* input2_in, \
78+
const size_t input2_size, \
79+
const size_t input2_ndim, \
80+
const size_t* input2_shape, \
81+
const size_t* input2_strides, \
82+
const size_t* where)
5683

5784
#endif
5885

dpnp/backend/include/dpnp_iface.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,14 +966,20 @@ INP_DLLEXPORT void dpnp_invert_c(void* array1_in, void* result, size_t size);
966966
#define MACRO_2ARG_3TYPES_OP(__name__, __operation1__, __operation2__) \
967967
template <typename _DataType_output, typename _DataType_input1, typename _DataType_input2> \
968968
INP_DLLEXPORT void __name__(void* result_out, \
969+
const size_t result_size, \
970+
const size_t result_ndim, \
971+
const size_t* result_shape, \
972+
const size_t* result_strides, \
969973
const void* input1_in, \
970974
const size_t input1_size, \
975+
const size_t input1_ndim, \
971976
const size_t* input1_shape, \
972-
const size_t input1_shape_ndim, \
977+
const size_t* input1_strides, \
973978
const void* input2_in, \
974979
const size_t input2_size, \
980+
const size_t input2_ndim, \
975981
const size_t* input2_shape, \
976-
const size_t input2_shape_ndim, \
982+
const size_t* input2_strides, \
977983
const size_t* where);
978984

979985
#include <dpnp_gen_2arg_3type_tbl.hpp>

dpnp/backend/kernels/dpnp_krnl_common.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ void dpnp_dot_c(void* result_out,
173173
const size_t* input2_shape,
174174
const size_t* input2_strides)
175175
{
176-
(void)result_strides;
177-
178176
DPNPC_ptr_adapter<_DataType_input1> input1_ptr(input1_in, input1_size);
179177
DPNPC_ptr_adapter<_DataType_input2> input2_ptr(input2_in, input2_size);
180178

@@ -195,14 +193,20 @@ void dpnp_dot_c(void* result_out,
195193
// there is no support of strides in multiply function
196194
// so result can be wrong if input array has non-standard (c-contiguous) strides
197195
dpnp_multiply_c<_DataType_output, _DataType_input1, _DataType_input2>(result,
196+
result_size,
197+
result_ndim,
198+
result_shape,
199+
result_strides,
198200
input1_in,
199201
input1_size,
200-
input1_shape,
201202
input1_ndim,
203+
input1_shape,
204+
input1_strides,
202205
input2_in,
203206
input2_size,
204-
input2_shape,
205207
input2_ndim,
208+
input2_shape,
209+
input2_strides,
206210
NULL);
207211
return;
208212
}

0 commit comments

Comments
 (0)