From ee987bcd1f6646fc37cf77090320fb4933eea958 Mon Sep 17 00:00:00 2001 From: Warren Weckesser Date: Sun, 8 Dec 2024 17:03:16 -0500 Subject: [PATCH] Add display of 4 input vars in the 'loop types' output pf ufunc_inspector. --- src/ufunc-inspector/ufunc_inspector.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ufunc-inspector/ufunc_inspector.c b/src/ufunc-inspector/ufunc_inspector.c index 5860e18..09facc2 100644 --- a/src/ufunc-inspector/ufunc_inspector.c +++ b/src/ufunc-inspector/ufunc_inspector.c @@ -165,7 +165,7 @@ ufunc_inspector(PyObject *self, PyObject *arg) } printf("ntypes = %d\n", ufunc->ntypes); - if (ufunc->ntypes > 0 && ufunc->nin > 0 && ufunc->nin < 4 && ufunc->nout == 1) { + if (ufunc->ntypes > 0 && ufunc->nin > 0 && ufunc->nin < 5 && ufunc->nout == 1) { printf("loop types:\n"); } for (int i = 0; i < ufunc->ntypes; ++i) { @@ -231,6 +231,18 @@ ufunc_inspector(PyObject *self, PyObject *arg) get_typechar_from_typenum(ufunc->types[4*i+3])); printf("\n"); } + else if (ufunc->nin == 4 && ufunc->nout == 1) { + printf("%3d: (%3d, %3d, %3d, %3d) -> %3d ", i, + ufunc->types[5*i], ufunc->types[5*i+1], + ufunc->types[5*i+2], ufunc->types[5*i+3], + ufunc->types[5*i+4]); + printf("(%c%c%c%c->%c) ", get_typechar_from_typenum(ufunc->types[5*i]), + get_typechar_from_typenum(ufunc->types[5*i+1]), + get_typechar_from_typenum(ufunc->types[5*i+2]), + get_typechar_from_typenum(ufunc->types[5*i+3]), + get_typechar_from_typenum(ufunc->types[5*i+4])); + printf("\n"); + } } if (ufunc->userloops != NULL) {