Table of Contents

Enum NDIterOpFlags

Namespace
NumSharp.Backends.Iteration
Assembly
NumSharp.dll

Per-operand flags during iteration. Matches NumPy's NPY_OP_ITFLAG_* constants.

[Flags]
public enum NDIterOpFlags : ushort

Fields

None = 0
WRITE = 1

Operand will be written to.

READ = 2

Operand will be read from.

READWRITE = WRITE | READ

Operand is read-write.

CAST = 4

Operand needs type conversion/byte swapping/alignment.

BUFNEVER = 8

Operand never needs buffering.

BUF_SINGLESTRIDE = 16

Buffer filling can use single stride.

REDUCE = 32

Operand is being reduced.

VIRTUAL = 64

Operand is virtual (no backing array).

WRITEMASKED = 128

Operand requires masking when copying buffer to array.

BUF_REUSABLE = 256

Buffer is fully filled and ready for reuse.

FORCECOPY = 512

Operand must be copied.

HAS_WRITEBACK = 1024

Operand has temporary data, write back at dealloc.

CONTIG = 2048

User requested contiguous operand.

BUF_REDUCE = 4096

The buffered double loop iterates this operand as a REDUCE operand: one of its two buffered strides is 0 — the inner one (its element repeats along the core, and the pointer steps per outer iteration) or the outer one (the core repeats per outer iteration) — and its buffer holds the core or the outer column only.

NumPy's NPY_OP_ITFLAG_REDUCE as npyiter_find_buffering_setup leaves it: set only under BUFREDUCE, and possibly on an operand that is not reduced at all (an unbuffered input whose strides make the reduce walk cheaper). REDUCE keeps the construction's meaning (the operand is written along a broadcast axis) for the iterator's public queries.