Image manipulation in parallel host threads with gpu
Still no answer:
I have two object instances manipulating images in parallel threads on the host
Each objects contains members
gpu::GpuMat a;
gpu::GpuMat b;
gpu::GpuMat c;
code is:
gpu_mutex->lock ();
a.upload ( a_data );
b.upload ( b_data );
gpu::subtract ( a, b, c );
c.download ( c_data );
gpu_mutex->unlock ();
I need the Mutex->Lock() around the algorithm to get correctly computed data in "c" in both host threads.
My assumption is, that without Mutex the "parallel" upload overwrites the data already in processing.
What is the correct pattern to move multiple data to the gpu and compute the same algorithm in parallel?
I think i need some very basic advise, i'm fairly new to OpenCV.
Thanks!
Wolfram