RDF_DOUBLE#

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

RDF_DOUBLE(type, tw, th, ...)#

Calculate the minimum buffer length (in pixels) required to support double layout for RasterDataFlow.

RasterDataFlow is able to lay out VMEM buffers in three different ways, trading between VMEM usage and transfer latency. In order of most memory used to least, these are RDF_CIRCULAR > RDF_DOUBLE > RDF_SINGLE. The RDF_* 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. Double layout may be slower than RDF_CIRCULAR in some cases, but uses less VMEM and still allows pipelining data read/writes with DMA accesses. Double layout provides identical performance to RDF_CIRCULAR if the dim1 halo is zero (e.g. haloX in row major traversal).

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 RDF to fall back to RDF_SINGLE layout.

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

  • tw – Tile width in pixel (arena width, if RasterDataFlow::tileArena() API will be used)

  • th – Tile height in pixel (arena height, if RasterDataFlow::tileArena() API will be used)

  • ... – Optional arguments, specified in the following order:

    • haloX gives horizontal halo in pixel, defaults to 0

    • haloY gives vertical halo in pixel, defaults to 0

    • mode gives the transposition mode, defaults to TRANS_MODE_NONE