Skip to content

Commit a23a15f

Browse files
committed
Resolved warning and error with cython 3.0.0
1 parent af1af29 commit a23a15f

File tree

2 files changed

+56
-15
lines changed

2 files changed

+56
-15
lines changed

dpnp/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function(build_dpnp_cython_ext _trgt _src _dest)
99
if (DPNP_GENERATE_COVERAGE)
1010
target_compile_definitions(${_trgt} PRIVATE CYTHON_TRACE=1 CYTHON_TRACE_NOGIL=1)
1111
endif()
12+
target_compile_definitions(${_trgt} PRIVATE NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION)
1213
# NumPy
1314
target_include_directories(${_trgt} PRIVATE ${NumPy_INCLUDE_DIR})
1415
# Dpctl

dpnp/dparray.pyx

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ from libcpp cimport bool as cpp_bool
4040

4141
import numpy
4242

43+
from dpnp.dpnp_algo import (
44+
dpnp_astype,
45+
dpnp_flatten,
46+
)
47+
4348
# to avoid interference with Python internal functions
49+
from dpnp.dpnp_iface import asnumpy
4450
from dpnp.dpnp_iface import get_dpnp_descriptor as iface_get_dpnp_descriptor
4551
from dpnp.dpnp_iface import prod as iface_prod
4652
from dpnp.dpnp_iface import sum as iface_sum
@@ -86,29 +92,63 @@ from dpnp.dpnp_iface_arraycreation import (
8692
zeros,
8793
zeros_like,
8894
)
89-
from dpnp.dpnp_iface_bitwise import *
90-
from dpnp.dpnp_iface_counting import *
91-
from dpnp.dpnp_iface_indexing import *
92-
from dpnp.dpnp_iface_libmath import *
93-
from dpnp.dpnp_iface_linearalgebra import *
94-
from dpnp.dpnp_iface_logic import *
95-
from dpnp.dpnp_iface_logic import all, any # TODO do the same as for iface_sum
96-
from dpnp.dpnp_iface_manipulation import *
97-
from dpnp.dpnp_iface_mathematical import *
98-
from dpnp.dpnp_iface_searching import *
99-
from dpnp.dpnp_iface_sorting import *
100-
from dpnp.dpnp_iface_statistics import *
95+
from dpnp.dpnp_iface_indexing import (
96+
choose,
97+
diagonal,
98+
take,
99+
)
100+
from dpnp.dpnp_iface_linearalgebra import matmul
101+
from dpnp.dpnp_iface_logic import ( # TODO do the same as for iface_sum
102+
all,
103+
any,
104+
equal,
105+
greater,
106+
greater_equal,
107+
less,
108+
less_equal,
109+
not_equal,
110+
)
111+
from dpnp.dpnp_iface_manipulation import (
112+
copyto,
113+
repeat,
114+
squeeze,
115+
transpose,
116+
)
117+
from dpnp.dpnp_iface_mathematical import (
118+
add,
119+
around,
120+
conjugate,
121+
cumprod,
122+
cumsum,
123+
divide,
124+
multiply,
125+
negative,
126+
power,
127+
remainder,
128+
subtract,
129+
)
130+
from dpnp.dpnp_iface_searching import argmax, argmin
131+
from dpnp.dpnp_iface_sorting import (
132+
argsort,
133+
partition,
134+
sort,
135+
)
101136
from dpnp.dpnp_iface_statistics import ( # TODO do the same as for iface_sum
102137
max,
138+
mean,
103139
min,
140+
std,
141+
var,
104142
)
105-
from dpnp.dpnp_iface_trigonometric import *
106-
from dpnp.dpnp_iface_types import *
143+
from dpnp.dpnp_iface_types import float64
107144

108145
cimport numpy
109146

110147
cimport dpnp.dpnp_utils as utils
111-
from dpnp.dpnp_algo cimport *
148+
from dpnp.dpnp_algo cimport (
149+
dpnp_memory_alloc_c,
150+
dpnp_memory_free_c,
151+
)
112152

113153

114154
# initially copied from original

0 commit comments

Comments
 (0)