MCPcopy Create free account
hub / github.com/numpy/numpy / ufunc_at__slow_iter

Function ufunc_at__slow_iter

numpy/core/src/umath/ufunc_object.c:6065–6236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6063}
6064
6065static int
6066ufunc_at__slow_iter(PyUFuncObject *ufunc, NPY_ARRAYMETHOD_FLAGS flags,
6067 PyArrayMapIterObject *iter, PyArrayIterObject *iter2,
6068 PyArrayObject *op1_array, PyArrayObject *op2_array,
6069 PyArray_Descr *operation_descrs[3],
6070 PyArrayMethod_StridedLoop *strided_loop,
6071 PyArrayMethod_Context *context,
6072 NpyAuxData *auxdata
6073 )
6074{
6075 NpyIter *iter_buffer = NULL;
6076 PyArrayObject *array_operands[3] = {NULL, NULL, NULL};
6077 int buffersize;
6078 int errormask = 0;
6079 int res = 0;
6080 int nop = 0;
6081 NpyIter_IterNextFunc *iternext;
6082 char * err_msg = NULL;
6083 NPY_BEGIN_THREADS_DEF;
6084
6085 if (_get_bufsize_errmask(NULL, ufunc->name, &buffersize, &errormask) < 0) {
6086 return -1;
6087 }
6088 array_operands[0] = new_array_op(op1_array, iter->dataptr);
6089 if (iter2 != NULL) {
6090 array_operands[1] = new_array_op(op2_array, PyArray_ITER_DATA(iter2));
6091 array_operands[2] = new_array_op(op1_array, iter->dataptr);
6092 nop = 3;
6093 }
6094 else {
6095 array_operands[1] = new_array_op(op1_array, iter->dataptr);
6096 array_operands[2] = NULL;
6097 nop = 2;
6098 }
6099 /* Set up the flags */
6100 npy_uint32 op_flags[3];
6101 op_flags[0] = NPY_ITER_READONLY|
6102 NPY_ITER_ALIGNED;
6103
6104 if (iter2 != NULL) {
6105 op_flags[1] = NPY_ITER_READONLY|
6106 NPY_ITER_ALIGNED;
6107 op_flags[2] = NPY_ITER_WRITEONLY|
6108 NPY_ITER_ALIGNED|
6109 NPY_ITER_ALLOCATE|
6110 NPY_ITER_NO_BROADCAST|
6111 NPY_ITER_NO_SUBTYPE;
6112 }
6113 else {
6114 op_flags[1] = NPY_ITER_WRITEONLY|
6115 NPY_ITER_ALIGNED|
6116 NPY_ITER_ALLOCATE|
6117 NPY_ITER_NO_BROADCAST|
6118 NPY_ITER_NO_SUBTYPE;
6119 }
6120 /*
6121 * Create NpyIter object to "iterate" over single element of each input
6122 * operand. This is an easy way to reuse the NpyIter logic for dealing

Callers 1

ufunc_atFunction · 0.85

Calls 10

_get_bufsize_errmaskFunction · 0.85
new_array_opFunction · 0.85
NpyIter_AdvancedNewFunction · 0.85
NpyIter_DeallocateFunction · 0.85
NpyIter_GetDataPtrArrayFunction · 0.85
PyArray_MapIterNextFunction · 0.85
_check_ufunc_fperrFunction · 0.85

Tested by

no test coverage detected