Ask Your Question

josh97's profile - activity

2017-05-26 01:19:49 -0500 answered a question Passing an array of cv::GpuMat to a cuda kernel?

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;
    ..
    ...
}