Skip to content

Commit

Permalink
Add display of 4 input vars in the 'loop types' output pf ufunc_inspe…
Browse files Browse the repository at this point in the history
…ctor.
  • Loading branch information
WarrenWeckesser committed Dec 8, 2024
1 parent 7818f5a commit ee987bc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/ufunc-inspector/ufunc_inspector.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit ee987bc

Please sign in to comment.