Skip to content

Removing multiple definition of shape type in cython #1098

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

Merged
merged 2 commits into from
Dec 30, 2021
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
8 changes: 3 additions & 5 deletions dpnp/dparray.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,18 @@ Represents multi-dimensional array using USM interface for an Intel GPU device.
"""


from libcpp.vector cimport vector
from dpnp.dpnp_algo cimport shape_type_c


ctypedef vector.vector[long] dparray_shape_type

cdef class dparray:
"""Multi-dimensional array using USM interface for an Intel GPU device.

"""

cdef:
readonly Py_ssize_t _dparray_size
public dparray_shape_type _dparray_shape
public dparray_shape_type _dparray_strides
public shape_type_c _dparray_shape
public shape_type_c _dparray_strides
readonly object _dparray_dtype
readonly char * _dparray_data
size_t iter_idx
Expand Down
2 changes: 1 addition & 1 deletion dpnp/dparray.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ cdef class dparray:
cdef size_previous = self.size

cdef long size_new = 1
cdef dparray_shape_type shape_new
cdef shape_type_c shape_new
shape_new.reserve(len(shape_tup))

for shape_it in shape_tup:
Expand Down
5 changes: 5 additions & 0 deletions dpnp/dpnp_algo/__init__.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@
# THE POSSIBILITY OF SUCH DAMAGE.
# *****************************************************************************

from libcpp.vector cimport vector

ctypedef long shape_elem_type
ctypedef vector.vector[shape_elem_type] shape_type_c

from dpnp.dpnp_algo.dpnp_algo cimport *
6 changes: 1 addition & 5 deletions dpnp/dpnp_algo/dpnp_algo.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@
# THE POSSIBILITY OF SUCH DAMAGE.
# *****************************************************************************

from libcpp.vector cimport vector
from libcpp cimport bool as cpp_bool

from dpnp.dpnp_utils.dpnp_algo_utils cimport dpnp_descriptor


ctypedef long shape_elem_type
ctypedef vector.vector[shape_elem_type] shape_type_c

from dpnp.dpnp_algo cimport shape_elem_type, shape_type_c

cdef extern from "dpnp_iface_fptr.hpp" namespace "DPNPFuncName": # need this namespace for Enum import
cdef enum DPNPFuncName "DPNPFuncName":
Expand Down
5 changes: 1 addition & 4 deletions dpnp/dpnp_utils/dpnp_algo_utils.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@
# *****************************************************************************

from libcpp cimport bool as cpp_bool
from libcpp.vector cimport vector

from dpnp.dpnp_algo.dpnp_algo cimport DPNPFuncType, DPNPFuncName


ctypedef vector.vector[long] shape_type_c
from dpnp.dpnp_algo cimport shape_type_c


cpdef checker_throw_runtime_error(function_name, message)
Expand Down
2 changes: 1 addition & 1 deletion dpnp/dpnp_utils/dpnp_algo_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import numpy
import dpnp.config as config
import dpnp.dpnp_container as dpnp_container
import dpnp
from dpnp.dpnp_algo cimport dpnp_DPNPFuncType_to_dtype, dpnp_dtype_to_DPNPFuncType, get_dpnp_function_ptr
from dpnp.dpnp_algo.dpnp_algo cimport dpnp_DPNPFuncType_to_dtype, dpnp_dtype_to_DPNPFuncType, get_dpnp_function_ptr
from libcpp cimport bool as cpp_bool
from libcpp.complex cimport complex as cpp_complex

Expand Down