RDF_SINGLE#

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

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

Calculate the minimum buffer length (in pixels) required to support single 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 single layout to be used. 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 (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