Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The main problem is that you can't use GpuMat in .cu files (nvcc can't compile gpumat.hpp header). You can pass only GpuMat's members to functions from .cu file:

// .cu file

texture<uchar3, 2, cudaReadModeNormalizedFloat> rgbTex;

void cu_func(void* data, size_t step, int width, int height)
{
    cudaChannelFormatDesc desc = cudaCreateChannelDesc<uchar3>();
    cudaBindTexture2D(0, rgbTex, data, desc, width, height, step));
    ...
}

// .cpp file

void cu_func(void* data, size_t step, int width, int height);

void cpp_func(GpuMat Image)
{
    cu_func(Image.data, Image.step, Image.cols, Image.rows);
}