Skip to content

Commit

Permalink
Resolved warning and error with cython 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Jul 24, 2023
1 parent af1af29 commit a23a15f
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 15 deletions.
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

0 comments on commit a23a15f

Please sign in to comment.