RDF_CIRCULAR#
Defined in src/device/vpu_runtime/include/cupva_device/device_core.h
-
RDF_CIRCULAR(type, tw, th, haloX, haloY, ...)#
Calculate the minimum buffer length (in pixels) required to support a circular 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.
If halo is specified and a large enough buffer is provided, RasterDataFlow will prefer to use a circular buffer. Using a circular buffer means that halo in the first advancement dimension can be shared between subsequent tiles, which may increase performance. However, circular layout for RDF requires more VMEM compared to RDF_DOUBLE or RDF_SINGLE.
This macro calculates the number of pixels necessary in a buffer to allow a circular layout to be used for either row-major or column-major traversal. If only one traversal order is needed, using RDF_CIRCULAR_ROWMAJOR or RDF_CIRCULAR_COLUMNMAJOR may provide a smaller size. The output of this macro can be used as the size of a 1D array, either in a struct or with VMEM.
If a user wants to ensure circular 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 circular layout also for TRANS_MODE_2.
If the runtime RDF configuration exceeds the limits specified by the parameters to this macro, RDF will fall back to RDF_DOUBLE or RDF_SINGLE layouts. Note that RDF_CIRCULAR is supported only for reads to VMEM.
- Parameters:
type – The pixel data type
tw – Tile width in pixel
th – Tile height in pixel
haloX – Horizontal halo in pixel
haloY – vertical halo in pixel
... – Optional argument, the transposition mode. Defaults to TRANS_MODE_NONE.