TDF_SINGLE#
Defined in src/device/vpu_runtime/include/cupva_device/tensor_dataflow.h
-
TDF_SINGLE(type, tw, th, tz, ...)#
Calculate the minimum buffer length (in pixels) required to support single layout for TensorDataFlow.
TensorDataFlow is able to lay out VMEM buffers in two different ways, trading between VMEM usage and transfer latency. In order of most memory used to least, these are TDF_DOUBLE > TDF_SINGLE. The TDF_* macros are provided to allow users to know how much memory needs to be reserved for each layout.
This macro calculates the number of pixels necessary in a buffer to allow a single layout to be used for 3D tensor data. Single layout means that there is only enough space in VMEM for a single tile. This means that pipelining data reads/writes with DMA accesses is not possible. However, this layout has the smallest memory footprint of all layouts.
If a user wants to ensure single layout for a range of input parameters or data types, they should specify the worst-case scenario to this macro. For example, if user specifies transposition mode = TRANS_MODE_4 to this macro, the buffer will be large enough to support single layout also for TRANS_MODE_2.
Exceeding the limits set by the parameters in this macro will cause dataflow compilation to fail.
- Parameters:
type – argument, the pixel data type.
tw – Tile width in pixel
th – Tile height in pixel
tz – Tile depth in pixel (arena depth, for the third dimension of tensor data)
... – Optional arguments, specified in the following order:
haloX Optional argument, gives horizontal halo in pixel. Defaults to zero.
haloY Optional argument, gives vertical halo in pixel. Defaults to zero.
mode Optional argument, the transposition mode. Defaults to TRANS_MODE_NONE.