update int64-type w.r.t OS

This commit is contained in:
lzhengning 2021-06-17 22:13:39 +08:00
parent e095821843
commit a866cc2387
3 changed files with 8 additions and 4 deletions

View File

@ -146,7 +146,7 @@ ArrayOp::ArrayOp(PyObject* obj) {
long dims[args.shape.size()];
#endif
for (int i=0; i<args.shape.size(); i++)
dims[i] = (long) args.shape[i];
dims[i] = args.shape[i];
holder.assign(PyArray_New(
PyArray_Type, // subtype
args.shape.size(), // nd

View File

@ -388,7 +388,7 @@ DEF_IS(DataView, PyObject*) to_py_object(T a) {
long dims[a.shape.size()];
#endif
for (int i=0; i<a.shape.size(); i++)
dims[i] = (int64) a.shape[i];
dims[i] = a.shape[i];
PyObjHolder oh(PyArray_New(
PyArray_Type, // subtype
a.shape.size(), // nd

View File

@ -109,9 +109,13 @@ static void push_py_object(RingBuffer* rb, PyObject* obj, uint64& __restrict__ o
rb->push_t<NanoString>(args.dtype, offset);
rb->push(size, offset);
args.ptr = rb->get_ptr(size, offset);
#if defined(__linux__)
int64 dims[args.shape.size()];
#elif defined(__APPLE__)
long dims[args.shape.size()];
for (int i=0; i<args.shape.size(); i++)
dims[i] = args.shape[i];
#endif
for (int i = 0; i < args.shape.size(); i++)
dims[i] = args.shape[i];
PyObjHolder oh(PyArray_New(
PyArray_Type, // subtype
args.shape.size(), // nd