Skip to content

Switching shape_elem_type to ssize_t #1096

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 7 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
7 changes: 6 additions & 1 deletion dpnp/backend/include/dpnp_iface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
#define INP_DLLEXPORT
#endif

typedef long shape_elem_type;
#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#endif

typedef ssize_t shape_elem_type;

#include "dpnp_iface_fft.hpp"
#include "dpnp_iface_random.hpp"
Expand Down
2 changes: 1 addition & 1 deletion dpnp/dpnp_algo/__init__.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

from libcpp.vector cimport vector

ctypedef long shape_elem_type
ctypedef ssize_t shape_elem_type
ctypedef vector.vector[shape_elem_type] shape_type_c

from dpnp.dpnp_algo.dpnp_algo cimport *
2 changes: 1 addition & 1 deletion dpnp/dpnp_algo/dpnp_algo_statistics.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ cpdef utils.dpnp_descriptor dpnp_nanvar(utils.dpnp_descriptor arr, ddof):
# dpnp_isnan does not support USM array as input in comparison to dpnp.isnan
cdef utils.dpnp_descriptor mask_arr = dpnp.get_dpnp_descriptor(dpnp.isnan(arr.get_pyobj()))
n = dpnp.count_nonzero(mask_arr.get_pyobj())
res_size = arr.size - n
res_size = int(arr.size - n)
cdef DPNPFuncType param1_type = dpnp_dtype_to_DPNPFuncType(arr.dtype)

cdef DPNPFuncData kernel_data = get_dpnp_function_ptr(DPNP_FN_NANVAR, param1_type, param1_type)
Expand Down