Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Image manipulation in parallel threads with gpu

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; and after uploading a and b they call: 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

Image manipulation in parallel host threads with gpu

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; and after uploading a and b they call: 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

Image manipulation in parallel host threads with gpu

I have two object instances manipulating images in parallel threads on the host Each objects contains members members
gpu::GpuMat a; a;
gpu::GpuMat b; b;
gpu::GpuMat c; c;

and after uploading a and b they call: call:

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. processing.
What is the correct pattern to move multiple data to the gpu and compute the same algorithm in parallel? parallel?
I think i need some very basic advise, i'm fairly new to OpenCV. Thanks! OpenCV.
Thanks!
Wolfram

Image manipulation in parallel host threads with gpu

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;

and after uploading a and b they call:

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

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;

and after uploading a and b they call:

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

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;

and after uploading a and b they call: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