Multiple Buffers
NvMedia and CUDA use different portions of the NVIDIA hardware. In the example above, the compute hardware is idle during 2D processing, and the 2D hardware is idle during compute processing. The pipeline can be made more efficient by allocating one (1) or more additional buffers and cycling between them, creating a queue of frames. This way, CUDA can process one image while NvMedia prepares the next one. No additional sync objects are needed, but it is necessary to generate a fence for each frame, and therefore you must keep track of which fence is associated with the current contents of each buffer. Once a stream has multiple buffers available, there are several different possible modes of operation to consider.
