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

Function NpyIter_RequiresBuffering

numpy/core/src/multiarray/nditer_api.c:832–855  ·  view source on GitHub ↗

NUMPY_API * Whether the iteration could be done with no buffering. */

Source from the content-addressed store, hash-verified

830 * Whether the iteration could be done with no buffering.
831 */
832NPY_NO_EXPORT npy_bool
833NpyIter_RequiresBuffering(NpyIter *iter)
834{
835 npy_uint32 itflags = NIT_ITFLAGS(iter);
836 /*int ndim = NIT_NDIM(iter);*/
837 int iop, nop = NIT_NOP(iter);
838
839 npyiter_opitflags *op_itflags;
840
841 if (!(itflags&NPY_ITFLAG_BUFFER)) {
842 return 0;
843 }
844
845 op_itflags = NIT_OPITFLAGS(iter);
846
847 /* If any operand requires a cast, buffering is mandatory */
848 for (iop = 0; iop < nop; ++iop) {
849 if (op_itflags[iop]&NPY_OP_ITFLAG_CAST) {
850 return 1;
851 }
852 }
853
854 return 0;
855}
856
857/*NUMPY_API
858 * Whether the iteration loop, and in particular the iternext()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected