Skip to main content

Module flags

Module flags 

Source
Expand description

Bit flags, as reported in TensorDesc::flags.

A bitfield rather than more discrete fields: the additions this protocol is most likely to need are booleans, and each one spent as its own u32 would grow the descriptor – which after release costs a capsule-name bump. Spending one u32 now buys 32 of them for free.

Constants§

CPU_ACCESS_DECLARED
The producer reports its declared crate::CpuAccess in CPU_READ and CPU_WRITE. When clear the declaration is unknown and an importer keeps its own default. Bit 1.
CPU_READ
The declaration includes CPU reads. Bit 2.
CPU_WRITE
The declaration includes CPU writes. Bit 3.
SYNC_PRESENT
[TensorDesc::sync] carries a real handle. When clear, sync is meaningless and must not be waited on.
VIEW
The tensor addresses part of a larger buffer (a view/batch sub-region, at any offset), so an importer must treat its rows as sharing cache lines with bytes outside it. Clear means a whole tensor, which is also what a producer that predates the bit reports. Bit 4.

Functions§

cpu_access
The declared access flags reports, or None when the producer did not report one.
from_cpu_access
The flag bits reporting access.