Skip to content

Commit dd47c08

Browse files
antonwolfyoleksandr-pavlyknpolina4vtavanavlad-perevezentsev
authored
Merge master into gold/2021 (#1315)
* Complete support of python 3.10 in external CI (#1269) * Set minimum required versions & fix debug building (#1270) * Set minimum required versions & fix debug building * Fix typo * Add support of NumPy 1.24 (#1276) * Set minimum required versions & fix debug building * Add support of numpy 1.24 * Get rid of 'has_aspect_host' property in tests (#1274) * Set minimum required versions & fix debug building * Get rid of 'has_aspect_host' property in tests * Update tests/test_sycl_queue.py Co-authored-by: Oleksandr Pavlyk <[email protected]> Co-authored-by: Oleksandr Pavlyk <[email protected]> * Add support of dpnp.less_equal() (#1275) * Set minimum required versions & fix debug building * Add support of dpnp.less_equal() * Test no broadcast together with input shapes * Add support of comparison operations (#1278) * Use eye() function from dpctl.tensor. (#1271) * Use eye() function from dpctl.tensor. * Add missed order in test for eye() function. * Updated copyright year. Added parameter like for eye() function. * Removed input argumet additional kwards for eye() function. * Get rid of unsupported types in array creation tests (#1283) * Add support of logical comparison operations (#1280) * Add device and sycl_queue keyword arguments to random calls (#1277) * Set minimum required versions & fix debug building * Add device and sycl_queue keyword arguments to random calls * Add device and sycl_queue to dpnp.random.seed() & use random values if seed is None * Update dpnp/random/dpnp_iface_random.py Co-authored-by: Oleksandr Pavlyk <[email protected]> --------- Co-authored-by: Oleksandr Pavlyk <[email protected]> * add __repr__ * add __str__ * reviewer's comments * Fixed gh-1272 (#1287) * Support high=None in dpnp.randint() (#1284) * linter changes applied * Add operation __index__ and __complex__ (#1285) * Add operation __index__ and __complex__ * Add tests * Update tests with proper call of dpctl.SyclQueue() (#1290) * Update minimum required versions of dependent components. (#1289) * dpnp.add() doesn't work properly with a scalar (#1288) * dpnp.add() doesn't work properly with a scalar * get rid of dpctl.SyclQueue() call in tests with unsupported device keyword * Add a fix for crash on CPU device * USM type in operations with a scalar * Porting fix for crash to logic kernel * Add dlpack support with tests and docstrings * Add a test for dlpack with dpt * Fix remarks, add _create_from_usm_ndarray func and move tests to test_sycl_queue * Use tril() and triu() function from dpctl.tensor (#1286) * Use tril() function from dpctl.tensor * Use triu() function from dpctl.tensor * Changed tests for tril() and triu() functions. * Skip tests for tril() and triu() functions with usm_type. * dpnp.subtract() doesn't work properly with a scalar (#1292) * dpnp.add() doesn't work properly with a scalar * dpnp.subtract() doesn't work properly with a scalar * USM type in operations with a scalar * Rollback excluded 'floor_divide' tests from skip scope * Explicit vector operations instead of saturation functions * Use std::int32_t and std::int64_t types * Tune tail's loop of kernel for the vector op * dpnp.divide() doesn't work properly with a scalar (#1295) * dpnp.add() doesn't work properly with a scalar * dpnp.subtract() doesn't work properly with a scalar * dpnp.divide() doesn't work properly with a scalar * dpnp.divide() doesn't work properly with a scalar * Use std::int32_t and std::int64_t types * Disable floating-point optimizations that assume arguments and results are not NaNs or +-Inf * Fix issue with divide on Iris Xe * Updae example3 building from debug build script (#1298) * Remove temporary solution accepting CFD with equal SYCL context instead of queue (#1303) * Intel LLVM is to use conda's gcc toolchain, sysroot and target libraries (#1306) * Tests are crashing if no default device (#1311) * Setting version to 0.11.1 (#1308) --------- Co-authored-by: Oleksandr Pavlyk <[email protected]> Co-authored-by: Natalia Polina <[email protected]> Co-authored-by: Vahid Tavanashad <[email protected]> Co-authored-by: Vladislav Perevezentsev <[email protected]>
1 parent c7178ad commit dd47c08

Some content is hidden

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

70 files changed

+3460
-1895
lines changed

.github/workflows/conda-package.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@ jobs:
2929

3030
strategy:
3131
matrix:
32-
python: ['3.8', '3.9']
32+
python: ['3.8', '3.9', '3.10']
3333
os: [ubuntu-20.04, windows-latest]
34-
include:
35-
- python: '3.10'
36-
os: ubuntu-20.04
3734

3835
runs-on: ${{ matrix.os }}
3936

@@ -110,7 +107,7 @@ jobs:
110107

111108
strategy:
112109
matrix:
113-
python: ['3.8', '3.9']
110+
python: ['3.8', '3.9', '3.10']
114111
os: [ubuntu-20.04, ubuntu-latest]
115112

116113
experimental: [false]
@@ -215,7 +212,7 @@ jobs:
215212

216213
strategy:
217214
matrix:
218-
python: ['3.8', '3.9']
215+
python: ['3.8', '3.9', '3.10']
219216
experimental: [false]
220217

221218
continue-on-error: ${{ matrix.experimental }}
@@ -384,7 +381,7 @@ jobs:
384381

385382
strategy:
386383
matrix:
387-
python: ['3.8', '3.9']
384+
python: ['3.8', '3.9', '3.10']
388385
os: [ubuntu-20.04, windows-latest]
389386

390387
runs-on: ${{ matrix.os }}

0.build.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ THEDIR=$(dirname $(readlink -e ${BASH_SOURCE[0]}))
44
# . ${THEDIR}/0.env.sh
55
cd ${THEDIR}
66

7+
# Assign $TMP env variable to a directory where the script locates.
8+
# The env variable is used by compiler as a path to temporary folder,
9+
# where it can store a temporary files generated during compilation and linkage phases.
10+
# By default the compiler uses /tmp folder, but it is limited by the size and
11+
# there might be not enough space to temporary keep all generated data.
12+
export TMP=${THEDIR}
13+
14+
715
export DPNP_DEBUG=1
816

917
python setup.py clean
@@ -17,7 +25,8 @@ CC=icpx python setup.py build_ext --inplace
1725

1826
echo
1927
echo =========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
28+
DPCTL_INCLUDES=$(python -m dpctl --includes)
29+
icpx -fsycl -g -O0 -ggdb3 -fPIC dpnp/backend/examples/example3.cpp $DPCTL_INCLUDES -Idpnp -Idpnp/backend/include -Ldpnp -Wl,-rpath='$ORIGIN'/dpnp -ldpnp_backend_c -o example3
2130
# LD_DEBUG=libs,bindings,symbols ./example3
2231
./example3
2332

@@ -39,7 +48,7 @@ icpx -fsycl -g -fPIC dpnp/backend/examples/example3.cpp -Idpnp -Idpnp/backend/in
3948
# strings /usr/share/miniconda/envs/dpnp*/lib/libstdc++.so | grep GLIBCXX | sort -n
4049

4150

42-
# echo
51+
echo
4352
echo =========example1==============
4453
# LD_DEBUG=libs,bindings,symbols python examples/example1.py
4554
# LD_DEBUG=libs python examples/example1.py

conda-recipe/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ fi
2929
export CFLAGS="-Wl,-rpath,\$ORIGIN/../dpctl,-rpath,\$ORIGIN $CFLAGS"
3030
export LDFLAGS="-Wl,-rpath,\$ORIGIN/../dpctl,-rpath,\$ORIGIN $LDFLAGS"
3131

32+
# Intel LLVM must cooperate with compiler and sysroot from conda
33+
echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg
34+
export ICPXCFG="$(pwd)/icpx_for_conda.cfg"
35+
export ICXCFG="$(pwd)/icpx_for_conda.cfg"
36+
3237
$PYTHON setup.py build_clib
3338
$PYTHON setup.py build_ext install
3439

conda-recipe/meta.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ requirements:
1111
- numpy 1.19
1212
- cython
1313
- cmake >=3.19
14-
- dpctl >=0.13
15-
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2021.1.1') }}
14+
- dpctl >=0.14
15+
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2023.0.0') }}
1616
- onedpl-devel
1717
- tbb-devel
1818
- wheel
1919
build:
2020
- {{ compiler('cxx') }}
21-
- {{ compiler('dpcpp') }} >=2022.1 # [not osx]
21+
- {{ compiler('dpcpp') }} >=2023.0 # [not osx]
2222
run:
2323
- python
24-
- dpctl >=0.13
24+
- dpctl >=0.14
2525
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
2626
- {{ pin_compatible('mkl-dpcpp', min_pin='x.x', max_pin='x') }}
2727
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# The short X.Y version
3434
version = '0.11'
3535
# The full version, including alpha/beta/rc tags
36-
release = '0.11.0'
36+
release = '0.11.1'
3737

3838

3939
# -- General configuration ---------------------------------------------------

dpnp/backend/CMakeLists.txt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# *****************************************************************************
2-
# Copyright (c) 2016-2022, Intel Corporation
2+
# Copyright (c) 2016-2023, Intel Corporation
33
# All rights reserved.
44
#
55
# Redistribution and use in source and binary forms, with or without
@@ -27,7 +27,7 @@
2727

2828
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
2929

30-
# set(DPNP_VERSION 0.11.0)
30+
# set(DPNP_VERSION 0.11.1)
3131
# set(DPNP_API_VERSION 0.11)
3232

3333
# set directory where the custom finders live
@@ -93,6 +93,7 @@ string(CONCAT COMMON_COMPILE_FLAGS
9393
"-fsycl "
9494
"-fsycl-device-code-split=per_kernel "
9595
"-fno-approx-func "
96+
"-fno-finite-math-only "
9697
)
9798
string(CONCAT COMMON_LINK_FLAGS
9899
"-fsycl "
@@ -111,7 +112,7 @@ elseif(WIN32)
111112
# set(CMAKE_RANLIB "llvm-ranlib")
112113
# set(CMAKE_CXX_FLAGS "/EHsc")
113114

114-
string(APPEND COMMON_COMPILER_FLAGS
115+
string(APPEND COMMON_COMPILE_FLAGS
115116
"/EHsc "
116117
# "/Ox "
117118
# "/W3 "
@@ -133,23 +134,29 @@ string(CONCAT DPNP_WARNING_FLAGS
133134
"-Wextra "
134135
"-Wshadow "
135136
"-Wall "
136-
"-Wstring-prototypes "
137+
"-Wstrict-prototypes "
137138
"-Wformat "
138139
"-Wformat-security "
139140
)
140-
string(APPEND COMMON_COMPILER_FLAGS
141+
string(APPEND COMMON_COMPILE_FLAGS
141142
"${DPNP_WARNING_FLAGS}"
142143
)
143144

144145
# debug/release compile definitions
145146
if(DPNP_DEBUG_ENABLE)
146147
set(CMAKE_BUILD_TYPE "Debug")
147-
string(APPEND COMMON_COMPILER_FLAGS
148+
string(APPEND COMMON_COMPILE_FLAGS
148149
"-O0 "
150+
"-ggdb3 "
151+
)
152+
string(APPEND COMMON_LINK_FLAGS
153+
"-O0 "
154+
"-ggdb3 "
155+
"-fsycl-link-huge-device-code "
149156
)
150157
else()
151158
set(CMAKE_BUILD_TYPE "Release")
152-
string(APPEND COMMON_COMPILER_FLAGS
159+
string(APPEND COMMON_COMPILE_FLAGS
153160
"-O3 "
154161
)
155162
endif()
@@ -162,7 +169,7 @@ string(CONCAT DPNP_DEFS
162169
"-D_FORTIFY_SOURCE=2 "
163170
)
164171
if(NOT WIN32)
165-
string(APPEND COMMON_COMPILER_FLAGS
172+
string(APPEND COMMON_COMPILE_FLAGS
166173
"-fno-delete-null-pointer-checks "
167174
"-fstack-protector-strong "
168175
"-fno-strict-overflow "

dpnp/backend/doc/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "DPNP C++ backend kernel library"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 0.11.0
41+
PROJECT_NUMBER = 0.11.1
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

dpnp/backend/include/dpnp_gen_1arg_1type_tbl.hpp

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//*****************************************************************************
2-
// Copyright (c) 2016-2020, Intel Corporation
2+
// Copyright (c) 2016-2023, Intel Corporation
33
// All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
@@ -23,6 +23,8 @@
2323
// THE POSSIBILITY OF SUCH DAMAGE.
2424
//*****************************************************************************
2525

26+
#if defined(MACRO_1ARG_1TYPE_OP)
27+
2628
/*
2729
* This header file contains single argument element wise functions definitions
2830
*
@@ -35,10 +37,6 @@
3537
*
3638
*/
3739

38-
#ifndef MACRO_1ARG_1TYPE_OP
39-
#error "MACRO_1ARG_1TYPE_OP is not defined"
40-
#endif
41-
4240
#ifdef _SECTION_DOCUMENTATION_GENERATION_
4341

4442
#define MACRO_1ARG_1TYPE_OP(__name__, __operation1__, __operation2__) \
@@ -88,7 +86,7 @@
8886
const shape_elem_type* input1_strides, \
8987
const size_t* where);
9088

91-
#endif
89+
#endif // _SECTION_DOCUMENTATION_GENERATION_
9290

9391
MACRO_1ARG_1TYPE_OP(dpnp_conjugate_c, std::conj(input_elem), q.submit(kernel_func))
9492
MACRO_1ARG_1TYPE_OP(dpnp_copy_c, input_elem, q.submit(kernel_func))
@@ -107,3 +105,62 @@ MACRO_1ARG_1TYPE_OP(dpnp_square_c,
107105
oneapi::mkl::vm::sqr(q, input1_size, input1_data, result))
108106

109107
#undef MACRO_1ARG_1TYPE_OP
108+
109+
#elif defined(MACRO_1ARG_1TYPE_LOGIC_OP)
110+
111+
/*
112+
* This header file contains single argument element wise functions definitions
113+
*
114+
* Macro `MACRO_1ARG_1TYPE_LOGIC_OP` must be defined before usage
115+
*
116+
* Parameters:
117+
* - public name of the function and kernel name
118+
* - operation used to calculate the result
119+
*
120+
*/
121+
122+
#ifdef _SECTION_DOCUMENTATION_GENERATION_
123+
124+
#define MACRO_1ARG_1TYPE_LOGIC_OP(__name__, __operation__) \
125+
/** @ingroup BACKEND_API */ \
126+
/** @brief Per element operation function __name__ */ \
127+
/** */ \
128+
/** Function "__name__" executes operator "__operation__" over corresponding elements of input array */ \
129+
/** */ \
130+
/** @param[in] q_ref Reference to SYCL queue. */ \
131+
/** @param[out] result_out Output array. */ \
132+
/** @param[in] result_size Output array size. */ \
133+
/** @param[in] result_ndim Number of output array dimensions. */ \
134+
/** @param[in] result_shape Output array shape. */ \
135+
/** @param[in] result_strides Output array strides. */ \
136+
/** @param[in] input1_in Input array 1. */ \
137+
/** @param[in] input1_size Input array 1 size. */ \
138+
/** @param[in] input1_ndim Number of input array 1 dimensions. */ \
139+
/** @param[in] input1_shape Input array 1 shape. */ \
140+
/** @param[in] input1_strides Input array 1 strides. */ \
141+
/** @param[in] where Where condition. */ \
142+
/** @param[in] dep_event_vec_ref Reference to vector of SYCL events. */ \
143+
template <typename _DataType_input1> \
144+
DPCTLSyclEventRef __name__(DPCTLSyclQueueRef q_ref, \
145+
void* result_out, \
146+
const size_t result_size, \
147+
const size_t result_ndim, \
148+
const shape_elem_type* result_shape, \
149+
const shape_elem_type* result_strides, \
150+
const void* input1_in, \
151+
const size_t input1_size, \
152+
const size_t input1_ndim, \
153+
const shape_elem_type* input1_shape, \
154+
const shape_elem_type* input1_strides, \
155+
const size_t* where, \
156+
const DPCTLEventVectorRef dep_event_vec_ref);
157+
158+
#endif // _SECTION_DOCUMENTATION_GENERATION_
159+
160+
MACRO_1ARG_1TYPE_LOGIC_OP(dpnp_logical_not_c, !input1_elem)
161+
162+
#undef MACRO_1ARG_1TYPE_LOGIC_OP
163+
164+
#else
165+
#error "MACRO_1ARG_1TYPE_OP or MACRO_1ARG_1TYPE_LOGIC_OP is not defined"
166+
#endif // MACRO_1ARG_1TYPE_OP || MACRO_1ARG_1TYPE_LOGIC_OP

0 commit comments

Comments
 (0)