Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You need to manually convert array of GpuMat to array of PtrStepSz:

cv::cuda::GpuMat *mats = new cv::cuda::GpuMat[180];
// Initialize eachof the mats

cv::cuda::PtrStepSz<float> h_ptrs = new cv::cuda::PtrStepSz<float>[180];
for (int i = 0; i < 180; ++i)
    h_ptrs[i] = mats[i];

Then you need to copy h_ptrs to GPU memory:

cv::cuda::PtrStepSz<float> *d_ptrs = NULL;
cudaMalloc(&d_ptrs, 180 * sizeof(cv::cuda::PtrStepSz<float>));

cudaMemcpy(d_ptrs, h_ptrs, 180 * sizeof(cv::cuda::PtrStepSz<float>), cudaMemcpyHostToDevice);

Then you can pass d_ptrs to kernel:

 somename<<<...>>>(d_ptrs);