8000 MAINT: Rename to BUF_SINGLESTRIDE and use the new gap in the flags · numpy/numpy@ac282fc · GitHub
[go: up one dir, main page]

Skip to content

Commit ac282fc

Browse files
committed
MAINT: Rename to BUF_SINGLESTRIDE and use the new gap in the flags
1 parent 22f335c commit ac282fc

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

numpy/_core/src/multiarray/nditer_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,8 +1570,8 @@ NpyIter_DebugPrint(NpyIter *iter)
15701570
printf("VIRTUAL ");
15711571
if ((NIT_OPITFLAGS(iter)[iop])&NPY_OP_ITFLAG_WRITEMASKED)
15721572
printf("WRITEMASKED ");
1573-
if ((NIT_OPITFLAGS(iter)[iop])&NPY_OP_ITFLAG_SINGLESTRIDE)
1574-
printf("SINGLESTRIDE ");
1573+
if ((NIT_OPITFLAGS(iter)[iop])&NPY_OP_ITFLAG_BUF_SINGLESTRIDE)
1574+
printf("BUF_SINGLESTRIDE ");
15751575
printf("\n");
15761576
}
15771577
printf("|\n");
@@ -1950,7 +1950,7 @@ npyiter_fill_buffercopy_params(
19501950
/* copy setup is identical to non-reduced now. */
19511951
}
19521952

1953-
if (opitflags & NPY_OP_ITFLAG_SINGLESTRIDE) {
1953+
if (opitflags & NPY_OP_ITFLAG_BUF_SINGLESTRIDE) {
19541954
/* Flatten the copy into a single stride. */
19551955
*ndim_transfer = 1;
19561956
*op_shape = op_transfersize;

numpy/_core/src/multiarray/nditer_constr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ npyiter_find_buffering_setup(NpyIter *iter)
21962196
* If it is not a single stride, we must buffer the operand.
21972197
*/
21982198
if (op_single_stride_dims[iop] + is_reduce_op > best_dim) {
2199-
NIT_OPITFLAGS(iter)[iop] |= NPY_OP_ITFLAG_SINGLESTRIDE;
2199+
NIT_OPITFLAGS(iter)[iop] |= NPY_OP_ITFLAG_BUF_SINGLESTRIDE;
22002200
}
22012201
else {
22022202
op_is_buffered = 1;
@@ -2212,7 +2212,7 @@ npyiter_find_buffering_setup(NpyIter *iter)
22122212
* is 0.
22132213
*/
22142214
if (!is_reduce_op
2215-
&& NIT_OPITFLAGS(iter)[iop] & NPY_OP_ITFLAG_SINGLESTRIDE
2215+
&& NIT_OPITFLAGS(iter)[iop] & NPY_OP_ITFLAG_BUF_SINGLESTRIDE
22162216
&& NAD_STRIDES(axisdata)[iop] == 0) {
22172217
/* This op is always 0 strides, so even the buffer is that. */
22182218
inner_stride = 0;
@@ -2247,7 +2247,7 @@ npyiter_find_buffering_setup(NpyIter *iter)
22472247
" inner stride: %zd\n"
22482248
" reduce outer stride: %zd (if iterator uses reduce)\n",
22492249
iop, op_is_buffered, is_reduce_op,
2250-
(NIT_OPITFLAGS(iter)[iop] & NPY_OP_ITFLAG_SINGLESTRIDE) != 0,
2250+
(NIT_OPITFLAGS(iter)[iop] & NPY_OP_ITFLAG_BUF_SINGLESTRIDE) != 0,
22512251
inner_stride, reduce_outer_stride);
22522252

22532253
NBF_STRIDES(bufferdata)[iop] = inner_stride;

numpy/_core/src/multiarray/nditer_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
#define NPY_OP_ITFLAG_CAST 0x0004
123123
/* The operand never needs buffering (implies BUF_SINGLESTRIDE) */
124124
#define NPY_OP_ITFLAG_BUFNEVER 0x0008
125+
/* Whether the buffer filling can use a single stride (minus reduce if reduce) */
126+
#define NPY_OP_ITFLAG_BUF_SINGLESTRIDE 0x0010
125127
/* The operand is being reduced */
126128
#define NPY_OP_ITFLAG_REDUCE 0x0020
127129
/* The operand is for temporary use, does not have a backing array */
@@ -137,8 +139,6 @@
137139
#define NPY_OP_ITFLAG_FORCECOPY 0x0200
138140
/* The operand has temporary data, write it back at dealloc */
139141
#define NPY_OP_ITFLAG_HAS_WRITEBACK 0x0400
140-
/* Whether the buffer filling can use a single stride (minus reduce if reduce) */
141-
#define NPY_OP_ITFLAG_SINGLESTRIDE 0x0800
142142

143143
/*
144144
* The data layout of the iterator is fully specified by

0 commit comments

Comments
 (0)
294E
0