1 | initial version |
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;
..
...
}
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);
__global__ void somename(PtrStepSz<float> *mats)
{
x=threadIdx.x;
y=threadIdx.y;
mats[0] (y,x)=3;
..
...
}