Skip to content

Bug msvc #51

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
1 commit merged into from
Mar 9, 2011
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
2 changes: 2 additions & 0 deletions numpy/core/src/multiarray/arraytypes.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,7 @@ static void
}
/* convert from Python object to needed one */
#if @convert@
{
PyObject *new, *args;
/* call out to the Python builtin given by convstr */
args = Py_BuildValue("(N)", temp);
Expand All @@ -1608,6 +1609,7 @@ static void
if (temp == NULL) {
return;
}
}
#endif /* @convert@ */
if (@to@_setitem(temp,(char *)op, aop)) {
Py_DECREF(temp);
Expand Down
3 changes: 2 additions & 1 deletion numpy/core/src/multiarray/ctors.c
Original file line number Diff line number Diff line change
Expand Up @@ -2395,7 +2395,6 @@ PyArray_CopyAnyIntoOrdered(PyArrayObject *dst, PyArrayObject *src,
PyArray_StridedTransferFn *stransfer = NULL;
void *transferdata = NULL;
NpyIter *dst_iter, *src_iter;
NPY_BEGIN_THREADS_DEF;

NpyIter_IterNext_Fn dst_iternext, src_iternext;
char **dst_dataptr, **src_dataptr;
Expand All @@ -2408,6 +2407,8 @@ PyArray_CopyAnyIntoOrdered(PyArrayObject *dst, PyArrayObject *src,
npy_intp dst_size, src_size;
int needs_api;

NPY_BEGIN_THREADS_DEF;

if (!PyArray_ISWRITEABLE(dst)) {
PyErr_SetString(PyExc_RuntimeError,
"cannot write to array");
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/einsum.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#if NPY_EINSUM_DBG_TRACING
#define NPY_EINSUM_DBG_PRINTF(...) printf(__VA_ARGS__)
#else
#define NPY_EINSUM_DBG_PRINTF(...)
#define NPY_EINSUM_DBG_PRINTF
#endif
/**********************************************/

Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/item_selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1880,8 +1880,8 @@ PyArray_Nonzero(PyArrayObject *self)
}
else {
for (i = 0; i < ndim; ++i) {
stride = ndim*NPY_SIZEOF_INTP;
PyArrayObject *view;
stride = ndim*NPY_SIZEOF_INTP;

view = (PyArrayObject *)PyArray_New(Py_TYPE(self), 1,
&nonzero_count,
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/new_iterator.c.src
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#if NPY_IT_DBG_TRACING
#define NPY_IT_DBG_PRINTF(...) printf(__VA_ARGS__)
#else
#define NPY_IT_DBG_PRINTF(...)
#define NPY_IT_DBG_PRINTF
#endif
/**********************************************/

Expand Down
18 changes: 12 additions & 6 deletions numpy/core/src/umath/ufunc_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#if NPY_UF_DBG_TRACING
#define NPY_UF_DBG_PRINTF(...) printf(__VA_ARGS__)
#else
#define NPY_UF_DBG_PRINTF(...)
#define NPY_UF_DBG_PRINTF
#endif
/**********************************************/

Expand Down Expand Up @@ -1762,7 +1762,6 @@ iterator_loop(PyUFuncObject *self,
NpyIter *iter;
char *baseptrs[NPY_MAXARGS];
int needs_api;
NPY_BEGIN_THREADS_DEF;

NpyIter_IterNext_Fn iternext;
char **dataptr;
Expand All @@ -1771,6 +1770,8 @@ iterator_loop(PyUFuncObject *self,

PyArrayObject **op_it;

NPY_BEGIN_THREADS_DEF;

/* Set up the flags */
for (i = 0; i < nin; ++i) {
op_flags[i] = NPY_ITER_READONLY|
Expand Down Expand Up @@ -2792,7 +2793,6 @@ PyUFunc_ReductionOp(PyUFuncObject *self, PyArrayObject *arr,
npy_uint32 op_flags[2];
int i, idim, ndim, otype_final;
int needs_api, need_outer_iterator;
NPY_BEGIN_THREADS_DEF;

NpyIter *iter = NULL, *iter_inner = NULL;

Expand All @@ -2806,6 +2806,8 @@ PyUFunc_ReductionOp(PyUFuncObject *self, PyArrayObject *arr,
int buffersize = 0, errormask = 0;
PyObject *errobj = NULL;

NPY_BEGIN_THREADS_DEF;

NPY_UF_DBG_PRINTF("\nEvaluating ufunc %s.%s\n", ufunc_name, opname);

#if 0
Expand Down Expand Up @@ -3424,7 +3426,6 @@ PyUFunc_Reduceat(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *ind,
npy_uint32 op_flags[3];
int i, idim, ndim, otype_final;
int needs_api, need_outer_iterator;
NPY_BEGIN_THREADS_DEF;

NpyIter *iter = NULL;

Expand All @@ -3442,6 +3443,8 @@ PyUFunc_Reduceat(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *ind,
int buffersize = 0, errormask = 0;
PyObject *errobj = NULL;

NPY_BEGIN_THREADS_DEF;

reduceat_ind = (npy_intp *)PyArray_DATA(ind);
ind_size = PyArray_DIM(ind, 0);
red_axis_size = PyArray_DIM(arr, axis);
Expand Down Expand Up @@ -3599,6 +3602,8 @@ PyUFunc_Reduceat(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *ind,

NpyIter_IterNext_Fn iternext;
char **dataptr;
npy_intp count_m1;
npy_intp stride0, stride1;
npy_intp *stride;
npy_intp *count_ptr;
npy_intp stride0_ind = PyArray_STRIDE(op[0], axis);
Expand All @@ -3616,8 +3621,9 @@ PyUFunc_Reduceat(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *ind,


/* Execute the loop with just the outer iterator */
npy_intp count_m1 = PyArray_DIM(op[1], axis)-1;
npy_intp stride0 = 0, stride1 = PyArray_STRIDE(op[1], axis);
count_m1 = PyArray_DIM(op[1], axis)-1;
stride0 = 0;
stride1 = PyArray_STRIDE(op[1], axis);

NPY_UF_DBG_PRINTF("UFunc: Reduce loop with just outer iterator\n");

Expand Down