TDF_DOUBLE#

Defined in src/device/vpu_runtime/include/cupva_device/tensor_dataflow.h

TDF_DOUBLE(type, tw, th, tz, ...)#

Calculate the minimum buffer length (in pixels) required to support double 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 double layout to be used for 3D tensor data. Double layout uses more VMEM but allows pipelining data read/writes with DMA accesses.

If a user wants to ensure double 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 double layout also for TRANS_MODE_2.

Exceeding the limits set by the parameters in this macro will cause TDF to fall back to TDF_SINGLE layout.

Parameters:
  • type – argument, the pixel data type.

  • tw – Tile width in pixel

  • th – Tile height in pixel

  • tz – Tile depth in pixel

  • ... – 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.