Streams and Multi-GPU using CUVI
Using Streams with CUVI
CUVI framework provides a way to use streams with minimal coding effort. Each function call in CUVI takes an optional parameter to specify the stream on which it should run. The code below shows how a simple function call of CUVI can be divided into streaming calls on GPU. For most of the cases this will result in better performance as copying image data to GPU and processing that data on GPU happens simultaneously.
CUVI example
In this example we use CUVI's RGB2Gray function from Color Operations module on a full HD input image
|
Same example with Streams
Streams greatly help improve performance of your application. Instead of waiting of the image to be copied on GPU before processing, streaming enables processing the data as it arrives on GPU. While one stream is copying its data to GPU the other stream might be processing its own data at the exact same moment hence hiding data processing time in data copying time