Ask Your Question

Revision history [back]

You can directly pass the array of GpuMats to kernels, but use them as an array of PtrStepSz in the kernel. You don't have to copy it to GPU memory.

somename<<<...>>>(mats); In the kernel, access the array in this way: __global__ void somename(PtrStepSz<float> *mats) { x=threadIdx.x; y=threadIdx.y; mats[0] (y,x)=3; .. ... }

click to hide/show revision 2
No.2 Revision

You can directly pass the array of GpuMats to kernels, but use them as an array of PtrStepSz in the kernel. You don't have to copy it to GPU memory.

somename<<<...>>>(mats);

In the kernel, access the array in this way: way:

 __global__ void somename(PtrStepSz<float> *mats)
{
 x=threadIdx.x;
 y=threadIdx.y;
 mats[0] (y,x)=3;
 ..
 ...
}