Hi Everyone :rolleyes:
I am trying to use NI-IMAQ and CUDA to do real-time image acquisition(IMAQ) and processing(CUDA), my first trial is like below–
loop ()
{
IMAQfunction(&buffer); // grab a image to the buffer by NI-IMAQ function, (CPU)
CUDAfunction(buffer); // process the image bu CUDA, (GPU)
}
Now the problem is, the above process works fine but it is sequential.
The CUDA processing time + Host/Device I/O + display() together is only 2/3 of the IMAQ acquisition time,
so it will be great to make the CUDA and IMAQ process overlap,
I am thinking about the “Buffer ring” model like below–
loop ()
{
buffer[N]; //create a buffer list
Parallel() // The following process can be parallelly processed
{
IMAQfunction(&buffer[i%N]); // grab a image to the buffer[i%N] by NI-IMAQ function; (CPU)
//here i%N gives the mod
CUDAfunction(buffer[i%N-1]); // process last image buffer[i%N-1] by CUDA (GPU)
}
}
I have read something about the Async functions, but it don’t seem to fully solve my simple requirement. Please give me some advice to realize the parallel part
Thank you very much! :rolleyes: