Ask Your Question

com_ws's profile - activity

2015-11-24 07:58:29 -0600 received badge  Organizer (source)
2015-11-19 04:28:13 -0600 received badge  Editor (source)
2015-11-19 02:52:06 -0600 asked a question 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