Skip to content

Commit 2c3eeb2

Browse files
authored
Merge branch 'master' into samir-nasibli/enh/vonmisses_random
2 parents 3222bc5 + 61ae592 commit 2c3eeb2

22 files changed

+236
-105
lines changed

.github/workflows/conda-package.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ env:
88
jobs:
99
build:
1010
runs-on: ubuntu-20.04
11+
12+
strategy:
13+
matrix:
14+
python: [3.8, 3.9]
15+
1116
steps:
1217
- name: Install Intel repository
1318
run: |
@@ -24,9 +29,9 @@ jobs:
2429
sudo apt install --reinstall -y gcc-9 g++-9 libstdc++-9-dev
2530
- name: Install Intel OneAPI
2631
run: |
27-
sudo apt-get install intel-oneapi-mkl \
28-
intel-oneapi-mkl-devel \
29-
intel-oneapi-dpcpp-cpp-compiler
32+
sudo apt-get install intel-oneapi-mkl=2021.3.0-520 \
33+
intel-oneapi-mkl-devel=2021.3.0-520 \
34+
intel-oneapi-compiler-dpcpp-cpp=2021.3.0-3350
3035
- name: Checkout repo
3136
uses: actions/checkout@v2
3237
with:
@@ -41,7 +46,7 @@ jobs:
4146
. /opt/intel/oneapi/setvars.sh
4247
. ./scripts/install_cmake_lin.sh
4348
CHANNELS="-c dppy/label/dev -c intel -c defaults --override-channels"
44-
VERSIONS="--python 3.8"
49+
VERSIONS="--python ${{ matrix.python }}"
4550
TEST="--no-test"
4651
conda build \
4752
$TEST \
@@ -52,18 +57,23 @@ jobs:
5257
- name: Upload artifact
5358
uses: actions/upload-artifact@v2
5459
with:
55-
name: dpnp ${{ runner.os }}
60+
name: dpnp ${{ runner.os }} ${{ matrix.python }}
5661
path: /usr/share/miniconda/conda-bld/linux-64/dpnp-*.tar.bz2
5762

5863
upload:
5964
needs: build
6065
if: ${{ github.ref == 'refs/heads/master' }}
6166
runs-on: ubuntu-latest
67+
68+
strategy:
69+
matrix:
70+
python: [3.8, 3.9]
71+
6272
steps:
6373
- name: Download artifact
6474
uses: actions/download-artifact@v2
6575
with:
66-
name: dpnp ${{ runner.os }}
76+
name: dpnp ${{ runner.os }} ${{ matrix.python }}
6777

6878
- name: Install anaconda-client
6979
run: conda install anaconda-client

0.build.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/bin/bash
22
THEDIR=$(dirname $(readlink -e ${BASH_SOURCE[0]}))
33

4-
. ${THEDIR}/0.env.sh
4+
# . ${THEDIR}/0.env.sh
55
cd ${THEDIR}
66

77
export DPNP_DEBUG=1
88

99
python setup.py clean
10-
python setup.py build_clib
10+
DPLROOT=/opt/intel/oneapi/dpl/latest python setup.py build_clib
1111

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

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

conda-recipe/activate_env.sh

-7
This file was deleted.

conda-recipe/build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# if ONEAPI_ROOT is specified (use all from it)
44
if [ -n "${ONEAPI_ROOT}" ]; then
55
export DPCPPROOT=${ONEAPI_ROOT}/compiler/latest
6-
# TODO uncomment when CI will be changed
7-
# export MKLROOT=${ONEAPI_ROOT}/mkl/latest
6+
export MKLROOT=${ONEAPI_ROOT}/mkl/latest
87
export TBBROOT=${ONEAPI_ROOT}/tbb/latest
8+
export DPLROOT=${ONEAPI_ROOT}/dpl/latest
99
fi
1010

1111
# if DPCPPROOT is specified (work with custom DPCPP)

conda-recipe/meta.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ requirements:
88
host:
99
- python
1010
- setuptools
11-
- numpy >=1.15 # [win or osx or py==38]
11+
- numpy >=1.15 # [win or osx or py>=38]
1212
- numpy 1.17 # [linux and py==37]
1313
- cython
1414
- cmake >=3.16.5
@@ -30,10 +30,11 @@ build:
3030
number: {{ GIT_DESCRIBE_NUMBER }}
3131
include_recipe: False
3232
script_env:
33-
- _ONEAPI_ROOT # renamed for ignore in CI
34-
- _DPCPPROOT # renamed for ignore in CI
33+
- ONEAPI_ROOT
34+
- DPCPPROOT
3535
- MKLROOT
3636
- TBBROOT
37+
- DPLROOT
3738
- WHEELS_OUTPUT_FOLDER
3839

3940
test:

conda-recipe/run_test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# if ONEAPI_ROOT is specified (use all from it)
44
if [ -n "${ONEAPI_ROOT}" ]; then
55
export DPCPPROOT=${ONEAPI_ROOT}/compiler/latest
6-
# TODO uncomment when CI will be changed
7-
# export MKLROOT=${ONEAPI_ROOT}/mkl/latest
6+
export MKLROOT=${ONEAPI_ROOT}/mkl/latest
87
export TBBROOT=${ONEAPI_ROOT}/tbb/latest
8+
export DPLROOT=${ONEAPI_ROOT}/dpl/latest
99
fi
1010

1111
# if DPCPPROOT is specified (work with custom DPCPP)

dpnp/backend/CMakeLists.txt

+2-10
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
3838
# -----------------------------------------------------------------------------------------------
3939
if(DEFINED ENV{ONEAPI_ROOT})
4040
set(DPNP_ONEAPI_ROOT "$ENV{ONEAPI_ROOT}" CACHE PATH "Folder contains oneapi tool set")
41-
else()
42-
if(UNIX)
43-
set(DPNP_ONEAPI_ROOT "/opt/intel/oneapi" CACHE PATH "Folder contains oneapi tool set")
44-
elseif(WIN32)
45-
set(DPNP_ONEAPI_ROOT "C:/Program Files (x86)/Intel/oneAPI" CACHE PATH "Folder contains oneapi tool set")
46-
else()
47-
message(FATAL_ERROR "Unsupported system ${CMAKE_SYSTEM}")
48-
endif()
4941
endif()
5042

5143
option(DPNP_STATIC_LIB_ENABLE "Enable build DPNP static library" FALSE)
@@ -253,8 +245,8 @@ target_link_libraries(dpnp_backend_c PUBLIC ${DPNP_MATHLIB_DEP_LIBS})
253245

254246
# Parallel STL from DPC++
255247
if(NOT WIN32)
256-
find_package(PSTL REQUIRED)
257-
target_include_directories(dpnp_backend_c PUBLIC ${PSTL_INCLUDE_DIR})
248+
find_package(DPL REQUIRED)
249+
target_include_directories(dpnp_backend_c PUBLIC ${DPL_INCLUDE_DIR})
258250
endif()
259251

260252
# SYCL queue manager

dpnp/backend/cmake/Modules/FindPSTL.cmake dpnp/backend/cmake/Modules/FindDPL.cmake

+17-14
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,30 @@
2424
# *****************************************************************************
2525

2626
# The following variables are optionally searched for defaults
27-
# PSTL_ROOT_DIR: Base directory where all components are found
27+
# DPLROOT: Environment variable to specify custom search place
28+
# ONEAPI_ROOT: Environment variable to specify search place from oneAPI
2829
#
2930
# The following are set after configuration is done:
30-
# PSTL_FOUND
31-
# PSTL_INCLUDE_DIR
31+
# DPL_FOUND
32+
# DPL_INCLUDE_DIR
3233

3334
include(FindPackageHandleStandardArgs)
3435

35-
set(PSTL_ROOT_DIR
36-
"${DPNP_ONEAPI_ROOT}/dpl"
37-
CACHE PATH "Folder contains PSTL headers")
36+
set(DPNP_ONEAPI_DPL "$ENV{DPNP_ONEAPI_ROOT}/dpl/latest" CACHE PATH "Folder contains DPL files from ONEAPI_ROOT")
37+
38+
if(DEFINED ENV{DPLROOT})
39+
set(DPNP_DPLROOT "$ENV{DPLROOT}" CACHE PATH "Folder contains DPL files from DPLROOT")
40+
endif()
3841

3942
find_path(
40-
PSTL_INCLUDE_DIR oneapi/dpl/algorithm
41-
HINTS ENV CONDA_PREFIX ${PSTL_ROOT_DIR} # search order is important
42-
PATH_SUFFIXES include latest/linux/include
43-
DOC "Path to PSTL include files")
43+
DPL_INCLUDE_DIR oneapi/dpl/algorithm
44+
HINTS ${DPNP_DPLROOT} ${DPNP_ONEAPI_DPL} ENV CONDA_PREFIX ENV PREFIX # search order is important
45+
PATH_SUFFIXES include linux/include
46+
DOC "Path to DPL include files")
4447

45-
find_package_handle_standard_args(PSTL DEFAULT_MSG PSTL_INCLUDE_DIR)
48+
find_package_handle_standard_args(DPL DEFAULT_MSG DPL_INCLUDE_DIR)
4649

47-
if(PSTL_FOUND)
48-
message(STATUS "Found PSTL: (include: ${PSTL_INCLUDE_DIR})")
49-
# mark_as_advanced(PSTL_ROOT_DIR PSTL_INCLUDE_DIR)
50+
if(DPL_FOUND)
51+
message(STATUS "Found DPL: (include: ${DPL_INCLUDE_DIR})")
52+
# mark_as_advanced(DPNP_DPLROOT DPL_INCLUDE_DIR)
5053
endif()

dpnp/backend/cmake/Modules/FindMathLib.cmake

+12-9
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
# *****************************************************************************
2525

2626
# The following variables are optionally searched for defaults
27-
# MATHLIB_ROOT_DIR: Base directory where all components are found
27+
# MKLROOT: Environment variable to specify custom search place
28+
# ONEAPI_ROOT: Environment variable to specify search place from oneAPI
2829
#
2930
# The following are set after configuration is done:
3031
# MATHLIB_FOUND
@@ -33,9 +34,11 @@
3334

3435
include(FindPackageHandleStandardArgs)
3536

36-
set(MATHLIB_ROOT_DIR
37-
"${DPNP_ONEAPI_ROOT}/mkl"
38-
CACHE PATH "Folder contains mathlib")
37+
set(DPNP_ONEAPI_MKL "$ENV{DPNP_ONEAPI_ROOT}/mkl/latest" CACHE PATH "Folder contains Math Lib files from ONEAPI_ROOT")
38+
39+
if(DEFINED ENV{MKLROOT})
40+
set(DPNP_MKLROOT "$ENV{MKLROOT}" CACHE PATH "Folder contains Math Lib files from MKLROOT")
41+
endif()
3942

4043
if(UNIX)
4144
set(MATHLIB_SYCL_LIB
@@ -51,14 +54,14 @@ endif()
5154

5255
find_path(
5356
MATHLIB_INCLUDE_DIR oneapi/mkl.hpp
54-
HINTS ENV CONDA_PREFIX ENV PREFIX ${MATHLIB_ROOT_DIR} # search order is important
55-
PATH_SUFFIXES include latest/include
57+
HINTS ${DPNP_MKLROOT} ${DPNP_ONEAPI_MKL} ENV CONDA_PREFIX ENV PREFIX # search order is important
58+
PATH_SUFFIXES include include
5659
DOC "Path to mathlib include files")
5760

5861
find_path(
5962
MATHLIB_LIBRARY_DIR ${MATHLIB_SYCL_LIB}
60-
HINTS ENV CONDA_PREFIX ENV PREFIX ${MATHLIB_ROOT_DIR} # search order is important
61-
PATH_SUFFIXES lib latest/lib/intel64
63+
HINTS ${DPNP_MKLROOT} ${DPNP_ONEAPI_MKL} ENV CONDA_PREFIX ENV PREFIX # search order is important
64+
PATH_SUFFIXES lib lib/intel64
6265
DOC "Path to mathlib library files")
6366

6467
# TODO implement recurcive searching file (GLOB_RECURSE MY_PATH "/opt/intel/*/mkl.hpp")
@@ -68,5 +71,5 @@ find_package_handle_standard_args(MathLib DEFAULT_MSG MATHLIB_INCLUDE_DIR MATHLI
6871

6972
if(MathLib_FOUND)
7073
message(STATUS "Found MathLib: (include: ${MATHLIB_INCLUDE_DIR}, library: ${MATHLIB_LIBRARY_DIR})")
71-
mark_as_advanced(MATHLIB_ROOT_DIR MATHLIB_INCLUDE_DIR MATHLIB_LIBRARY_DIR)
74+
# mark_as_advanced(DPNP_MKLROOT MATHLIB_INCLUDE_DIR MATHLIB_LIBRARY_DIR)
7275
endif()

dpnp/backend/include/dpnp_iface_fft.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
* @param[in] axis Axis ID to compute by.
7171
* @param[in] input_boundarie Limit number of elements for @ref axis.
7272
* @param[in] inverse Using inverse algorithm.
73+
* @param[in] norm Normalization mode. 0 - backward, 1 - forward.
7374
*/
7475
template <typename _DataType>
7576
INP_DLLEXPORT void dpnp_fft_fft_c(const void* array_in,
@@ -79,6 +80,6 @@ INP_DLLEXPORT void dpnp_fft_fft_c(const void* array_in,
7980
size_t shape_size,
8081
long axis,
8182
long input_boundarie,
82-
size_t inverse);
83-
83+
size_t inverse,
84+
const size_t norm);
8485
#endif // BACKEND_IFACE_FFT_H

dpnp/backend/kernels/dpnp_krnl_common.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ cl::sycl::event dot(cl::sycl::queue& queue,
8484
size_t input1_strides,
8585
size_t input2_strides,
8686
size_t size,
87-
const cl::sycl::vector_class<cl::sycl::event>& dependencies = {})
87+
const std::vector<cl::sycl::event>& dependencies = {})
8888
{
8989
(void)dependencies;
9090

@@ -322,9 +322,7 @@ void dpnp_dot_c(void* result_out,
322322
}
323323
}
324324

325-
// deprecated? can be replaced with std::vector<cl::sycl::event>
326-
cl::sycl::vector_class<cl::sycl::event> dot_events;
327-
// std::vector<cl::sycl::event> dot_events;
325+
std::vector<cl::sycl::event> dot_events;
328326
dot_events.reserve(result_size);
329327

330328
size_t dot_st1 = ext_input1_strides[ext_input1_ndim - 1];

0 commit comments

Comments
 (0)