Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve warning and error with cython 3.0.0 #1495

Merged
merged 4 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Install dpnp dependencies
run: |
conda install numpy"<1.24" dpctl mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
cmake cython"<3" pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}
cmake cython pytest ninja scikit-build sysroot_linux-64">=2.28" ${{ env.CHANNELS }}

- name: Install cuPy dependencies
run: conda install cupy cudatoolkit=10.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
sudo apt-get install lcov
- name: Install dpnp dependencies
run: |
conda install cython"<3" llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
dpctl dpcpp_linux-64 sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel onedpl-devel ${{ env.CHANNELS }}
- name: Conda info
run: |
Expand Down
2 changes: 1 addition & 1 deletion conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ requirements:
- python
- setuptools
- numpy >=1.19,<1.25a0
- cython <3
- cython
- cmake >=3.21
- ninja
- git
Expand Down
1 change: 1 addition & 0 deletions dpnp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ function(build_dpnp_cython_ext _trgt _src _dest)
if (DPNP_GENERATE_COVERAGE)
target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1)
endif()
target_compile_definitions(${_trgt} PRIVATE NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
# NumPy
target_include_directories(${_trgt} PRIVATE ${NumPy_INCLUDE_DIR})
# Dpctl
Expand Down
70 changes: 55 additions & 15 deletions dpnp/dparray.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ from libcpp cimport bool as cpp_bool

import numpy

from dpnp.dpnp_algo import (
dpnp_astype,
dpnp_flatten,
)

# to avoid interference with Python internal functions
from dpnp.dpnp_iface import asnumpy
from dpnp.dpnp_iface import get_dpnp_descriptor as iface_get_dpnp_descriptor
from dpnp.dpnp_iface import prod as iface_prod
from dpnp.dpnp_iface import sum as iface_sum
Expand Down Expand Up @@ -86,29 +92,63 @@ from dpnp.dpnp_iface_arraycreation import (
zeros,
zeros_like,
)
from dpnp.dpnp_iface_bitwise import *
from dpnp.dpnp_iface_counting import *
from dpnp.dpnp_iface_indexing import *
from dpnp.dpnp_iface_libmath import *
from dpnp.dpnp_iface_linearalgebra import *
from dpnp.dpnp_iface_logic import *
from dpnp.dpnp_iface_logic import all, any # TODO do the same as for iface_sum
from dpnp.dpnp_iface_manipulation import *
from dpnp.dpnp_iface_mathematical import *
from dpnp.dpnp_iface_searching import *
from dpnp.dpnp_iface_sorting import *
from dpnp.dpnp_iface_statistics import *
from dpnp.dpnp_iface_indexing import (
choose,
diagonal,
take,
)
from dpnp.dpnp_iface_linearalgebra import matmul
from dpnp.dpnp_iface_logic import ( # TODO do the same as for iface_sum
all,
any,
equal,
greater,
greater_equal,
less,
less_equal,
not_equal,
)
from dpnp.dpnp_iface_manipulation import (
copyto,
repeat,
squeeze,
transpose,
)
from dpnp.dpnp_iface_mathematical import (
add,
around,
conjugate,
cumprod,
cumsum,
divide,
multiply,
negative,
power,
remainder,
subtract,
)
from dpnp.dpnp_iface_searching import argmax, argmin
from dpnp.dpnp_iface_sorting import (
argsort,
partition,
sort,
)
from dpnp.dpnp_iface_statistics import ( # TODO do the same as for iface_sum
max,
mean,
min,
std,
var,
)
from dpnp.dpnp_iface_trigonometric import *
from dpnp.dpnp_iface_types import *
from dpnp.dpnp_iface_types import float64

cimport numpy

cimport dpnp.dpnp_utils as utils
from dpnp.dpnp_algo cimport *
from dpnp.dpnp_algo cimport (
dpnp_memory_alloc_c,
dpnp_memory_free_c,
)


# initially copied from original
Expand Down