I prepared processing the Video source …
Cuz the image size is large and definition is high…
I can’t copy all the video to Device memory…
So I plan to create the double buffer and control the switch
to copy the videos of different time…
The procedure I planed shows below …
Loading the Videos (t=n) to the DRAM on CPU …
Copying the videos (t=n) to the Device memory 1…
3.1 Processing the videos (t=n) on GPU
3.2 During the procedure 2.2 , we load the videos (next timing , t=n+1)
and copy it to the Device memory 2 at the same time
4.1 After solving the Device memory 1 , GPU continues processing
the Device memory 2, and CPU loads and copies the video(t=n+2) to Device
memory 1
then goes on…
So … How to control CPU to load and copy data to Device_memory_1 while
GPU processes the Device_memory_2…
This is what I’d do – it may be wrong or stupid :magic: …
Run some threads, and one of the threads runs two async-synchronising CUDA streams to keep the two device-side buffers cooking.
The Boost thread library is pretty nice. There are some sample stream / async projects in the CUDA SDK - there is an async example that contains part of the solution.