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

Function _check_ufunc_fperr

numpy/core/src/umath/extobj.c:303–335  ·  view source on GitHub ↗

* check the floating point status * - errmask: mask of status to check * - extobj: ufunc pyvals object * may be null, in which case the thread global one is fetched * - ufunc_name: name of ufunc */

Source from the content-addressed store, hash-verified

301 * - ufunc_name: name of ufunc
302 */
303NPY_NO_EXPORT int
304_check_ufunc_fperr(int errmask, PyObject *extobj, const char *ufunc_name) {
305 int fperr;
306 PyObject *errobj = NULL;
307 int ret;
308 int first = 1;
309
310 if (!errmask) {
311 return 0;
312 }
313 fperr = npy_get_floatstatus_barrier((char*)extobj);
314 if (!fperr) {
315 return 0;
316 }
317
318 /* Get error object globals */
319 if (extobj == NULL) {
320 extobj = get_global_ext_obj();
321 if (extobj == NULL && PyErr_Occurred()) {
322 return -1;
323 }
324 }
325 if (_extract_pyvals(extobj, ufunc_name,
326 NULL, NULL, &errobj) < 0) {
327 Py_XDECREF(errobj);
328 return -1;
329 }
330
331 ret = PyUFunc_handlefperr(errmask, errobj, fperr, &first);
332 Py_XDECREF(errobj);
333
334 return ret;
335}
336
337
338NPY_NO_EXPORT int

Callers 9

PyUFunc_ReduceWrapperFunction · 0.85
execute_ufunc_loopFunction · 0.85
PyUFunc_AccumulateFunction · 0.85
PyUFunc_ReduceatFunction · 0.85
trivial_at_loopFunction · 0.85
ufunc_at__fast_iterFunction · 0.85
ufunc_at__slow_iterFunction · 0.85

Calls 3

_extract_pyvalsFunction · 0.85
PyUFunc_handlefperrFunction · 0.85

Tested by

no test coverage detected