Skip to content

Commit 6501ffe

Browse files
Merge pull request #1619 from IntelPython/merge_master_into_gold
Merge master into gold
2 parents 18415c8 + 4c5f844 commit 6501ffe

File tree

140 files changed

+5469
-2989
lines changed

Some content is hidden

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

140 files changed

+5469
-2989
lines changed

.github/workflows/build-sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
9292
- name: Install dpnp dependencies
9393
run: |
94-
conda install numpy"<1.24" dpctl mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
94+
conda install numpy"<1.24" dpctl">=0.15.1dev1" mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
9595
cmake cython pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
9696
9797
- name: Install cuPy dependencies

.github/workflows/conda-package.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,25 @@ env:
2727
test_sycl_queue.py
2828
test_umath.py
2929
test_usm_type.py
30-
third_party/cupy/core_tests/test_ndarray_complex_ops.py
30+
third_party/cupy/core_tests
3131
third_party/cupy/linalg_tests/test_product.py
3232
third_party/cupy/logic_tests/test_comparison.py
3333
third_party/cupy/logic_tests/test_truth.py
3434
third_party/cupy/manipulation_tests/test_basic.py
35+
third_party/cupy/manipulation_tests/test_dims.py
3536
third_party/cupy/manipulation_tests/test_join.py
3637
third_party/cupy/manipulation_tests/test_rearrange.py
3738
third_party/cupy/manipulation_tests/test_transpose.py
39+
third_party/cupy/math_tests/test_arithmetic.py
3840
third_party/cupy/math_tests/test_explog.py
41+
third_party/cupy/math_tests/test_floating.py
42+
third_party/cupy/math_tests/test_hyperbolic.py
43+
third_party/cupy/math_tests/test_matmul.py
3944
third_party/cupy/math_tests/test_misc.py
45+
third_party/cupy/math_tests/test_rounding.py
4046
third_party/cupy/math_tests/test_trigonometric.py
4147
third_party/cupy/sorting_tests/test_sort.py
48+
third_party/cupy/sorting_tests/test_count.py
4249
VER_JSON_NAME: 'version.json'
4350
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
4451
VER_SCRIPT2: "d = j['dpnp'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
@@ -395,3 +402,33 @@ jobs:
395402
run: anaconda --token ${{ env.ANACONDA_TOKEN }} upload --user dppy --label dev ${{ env.PACKAGE_NAME }}-*.tar.bz2
396403
env:
397404
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
405+
406+
cleanup_packages:
407+
name: Clean up anaconda packages
408+
needs: [upload]
409+
runs-on: 'ubuntu-latest'
410+
defaults:
411+
run:
412+
shell: bash -el {0}
413+
steps:
414+
- uses: conda-incubator/setup-miniconda@v2
415+
with:
416+
run-post: false
417+
channel-priority: "disabled"
418+
channels: conda-forge
419+
python-version: '3.11'
420+
421+
- name: Install anaconda-client
422+
run: conda install anaconda-client
423+
424+
- name: Checkout repo
425+
uses: actions/checkout@v2
426+
with:
427+
repository: IntelPython/devops-tools
428+
fetch-depth: 0
429+
430+
- name: Cleanup old packages
431+
run: |
432+
python scripts/cleanup-old-packages.py \
433+
--verbose --force --token ${{ secrets.ANACONDA_TOKEN }} \
434+
--package dppy/${{ env.PACKAGE_NAME }} --label dev

.github/workflows/generate_coverage.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,32 @@ jobs:
3939
- name: Install Lcov
4040
run: |
4141
sudo apt-get install lcov
42+
4243
- name: Install dpnp dependencies
4344
run: |
4445
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
4546
dpctl dpcpp_linux-64 sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel onedpl-devel ${{ env.CHANNELS }}
47+
4648
- name: Conda info
4749
run: |
4850
conda info
4951
conda list
52+
5053
- name: Build dpnp with coverage
5154
run: |
5255
python scripts/gen_coverage.py --pytest-opts="--ignore tests/test_random.py"
56+
5357
- name: Install coverall dependencies
5458
run: |
5559
sudo gem install coveralls-lcov
5660
pip install coveralls==3.2.0
61+
5762
- name: Upload coverage data to coveralls.io
5863
run: |
5964
echo "Processing pytest-coverage"
6065
export DPNP_PYTEST_LCOV=$(find . -name dpnp_pytest.lcov)
6166
coveralls-lcov -v -n $DPNP_PYTEST_LCOV > pytest-dpnp-c-api-coverage.json
67+
6268
# merge file with coverage data and upload
6369
echo "Merging files with coverage data"
6470
coveralls --service=github --merge=pytest-dpnp-c-api-coverage.json

CMakeLists.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
cmake_minimum_required(VERSION 3.21...3.26 FATAL_ERROR)
2-
3-
if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24")
4-
cmake_policy(SET CMP0135 NEW)
5-
endif()
1+
cmake_minimum_required(VERSION 3.21...3.27 FATAL_ERROR)
62

73
project(dpnp
84
DESCRIPTION "NumPy-like API accelerated by SYCL."
@@ -27,7 +23,7 @@ endif()
2723
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DPCTL_MODULE_PATH})
2824

2925

30-
find_package(IntelDPCPP REQUIRED)
26+
find_package(IntelSYCL REQUIRED PATHS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules NO_DEFAULT_PATH)
3127
find_package(TBB QUIET)
3228
if(TBB_FOUND)
3329
find_package(TBB REQUIRED)
@@ -77,7 +73,7 @@ FetchContent_Declare(
7773
)
7874
FetchContent_MakeAvailable(pybind11)
7975

80-
find_package(PythonExtensions REQUIRED)
76+
find_package(Python REQUIRED COMPONENTS Development.Module)
8177
find_package(NumPy REQUIRED)
8278

8379
set(CYTHON_FLAGS "-t -w \"${CMAKE_SOURCE_DIR}\"")

conda-recipe/meta.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ requirements:
88
host:
99
- python
1010
- setuptools
11-
- numpy 1.21
11+
- numpy
1212
- cython
1313
- cmake >=3.21
1414
- ninja
1515
- git
16-
- dpctl >=0.15.0
16+
- dpctl >=0.15.1dev1
1717
- mkl-devel-dpcpp {{ environ.get('MKL_VER', '>=2024.0.0') }}
1818
- onedpl-devel
1919
- tbb-devel
@@ -25,7 +25,7 @@ requirements:
2525
- sysroot_linux-64 >=2.28 # [linux]
2626
run:
2727
- python
28-
- dpctl >=0.15.0
28+
- dpctl >=0.15.1dev1
2929
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
3030
- {{ pin_compatible('mkl-dpcpp', min_pin='x.x', max_pin='x') }}
3131
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}

doc/docstring_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def func(a, b=None, c=True):
7878
-----------
7979
Some limitations in comparison to baseline, ex:
8080
Input array data types are limited by supported DPNP :ref:`Data types`.
81-
Parameter ``c`` is supported only with default value ``True``.
81+
Parameter `c` is supported only with default value ``True``.
8282
Otherwise the function will be executed sequentially on CPU.
8383
8484
See Also

dpnp/CMakeLists.txt

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,53 @@
11

22
function(build_dpnp_cython_ext _trgt _src _dest)
3+
set(options SYCL)
4+
cmake_parse_arguments(BUILD_DPNP_EXT "${options}" "" "" ${ARGN})
35
add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
46
message(STATUS "Using ${_trgt}")
5-
add_library(${_trgt} MODULE ${_generated_src})
7+
8+
Python_add_library(${_trgt} MODULE WITH_SOABI ${_generated_src})
69
set(_trgt_deps "${_trgt}_deps")
710
add_custom_target(${_trgt_deps} DEPENDS ${_src})
811
add_dependencies(${_trgt} ${_trgt_deps})
12+
13+
if (BUILD_DPNP_EXT_SYCL)
14+
add_sycl_to_target(TARGET ${_trgt} SOURCES ${_generated_src})
15+
endif()
16+
917
if (DPNP_GENERATE_COVERAGE)
1018
target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1)
19+
target_compile_options(${_trgt} PRIVATE "-fno-sycl-use-footer")
1120
endif()
12-
target_compile_definitions(${_trgt} PRIVATE NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
21+
1322
# NumPy
23+
target_compile_definitions(${_trgt} PRIVATE NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
1424
target_include_directories(${_trgt} PRIVATE ${NumPy_INCLUDE_DIR})
25+
1526
# Dpctl
1627
target_include_directories(${_trgt} PRIVATE ${Dpctl_INCLUDE_DIR})
1728
target_link_directories(${_trgt} PRIVATE ${Dpctl_INCLUDE_DIR}/..)
18-
target_link_libraries(${_trgt} DPCTLSyclInterface)
29+
target_link_libraries(${_trgt} PRIVATE DPCTLSyclInterface)
1930

2031
set(_linker_options "LINKER:${DPNP_LDFLAGS}")
2132
target_link_options(${_trgt} PRIVATE ${_linker_options})
22-
python_extension_module(${_trgt})
2333

2434
if (DPNP_GENERATE_COVERAGE)
2535
set(_copy_cxx_trgt "${_trgt}_copy_cxx")
2636
add_custom_target(
27-
${_copy_cxx_trgt} ALL
28-
COMMAND ${CMAKE_COMMAND}
29-
-DSOURCE_FILE=${_generated_src}
30-
-DDEST=${CMAKE_CURRENT_SOURCE_DIR}
31-
-P ${CMAKE_SOURCE_DIR}/dpnp/cmake/copy_existing.cmake
32-
DEPENDS ${_trgt}
33-
VERBATIM
34-
COMMENT "Copying Cython-generated source for target ${_trgt} to dpnp source layout"
37+
${_copy_cxx_trgt} ALL COMMAND ${CMAKE_COMMAND}
38+
-DSOURCE_FILE=${_generated_src}
39+
-DDEST=${CMAKE_CURRENT_SOURCE_DIR}
40+
-P ${CMAKE_SOURCE_DIR}/dpnp/cmake/copy_existing.cmake
41+
DEPENDS ${_trgt}
42+
VERBATIM COMMENT "Copying Cython-generated source for target ${_trgt} to dpnp source layout"
3543
)
3644
endif()
3745
install(TARGETS ${_trgt} LIBRARY DESTINATION ${_dest})
3846
endfunction()
3947

4048
function(build_dpnp_cython_ext_with_backend _trgt _src _dest)
4149
build_dpnp_cython_ext(${_trgt} ${_src} ${_dest})
42-
target_link_libraries(${_trgt} dpnp_backend_library)
50+
target_link_libraries(${_trgt} PRIVATE dpnp_backend_library)
4351
if (UNIX)
4452
set_target_properties(${_trgt} PROPERTIES INSTALL_RPATH "$ORIGIN/..")
4553
endif()

0 commit comments

Comments
 (0)