File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1074,6 +1074,28 @@ Construction and Destruction
1074
1074
1075
1075
Returns ``NPY_SUCCEED `` or ``NPY_FAIL ``.
1076
1076
1077
+ .. cfunction :: npy_bool NpyIter_IsFirstVisit(NpyIter* iter, int iop)
1078
+
1079
+ Checks to see whether this is the first time the elements of the
1080
+ specified reduction operand which the iterator points at are being
1081
+ seen for the first time. The function returns a reasonable answer
1082
+ for reduction operands and when buffering is disabled. The answer
1083
+ may be incorrect for buffered non-reduction operands.
1084
+
1085
+ This function is intended to be used in EXTERNAL_LOOP mode only,
1086
+ and will produce some wrong answers when that mode is not enabled.
1087
+
1088
+ If this function returns true, the caller should also check the inner
1089
+ loop stride of the operand, because if that stride is 0, then only
1090
+ the first element of the innermost external loop is being visited
1091
+ for the first time.
1092
+
1093
+ *WARNING *: For performance reasons, 'iop' is not bounds-checked,
1094
+ it is not confirmed that 'iop' is actually a reduction operand,
1095
+ and it is not confirmed that EXTERNAL_LOOP mode is enabled. These
1096
+ checks are the responsibility of the caller, and should be done
1097
+ outside of any inner loops.
1098
+
1077
1099
Functions For Iteration
1078
1100
-----------------------
1079
1101
You can’t perform that action at this time.
0 commit comments