Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

openCLExecuteKernelInterop, passing uchar* data results in null pointer inside kernel

So I have this really annoying problem involving a custom kernel and cv::ocl::openCLExecuteKernelInterop.

The problem is that whenever I use uchar* as argument type to the kernel, the value during runtime is null (0x00000000), while I made sure several times that the .data member of the image has a valid value and is passed to the args vector correctly. (The data member is of type uchar*; I use it to pass the cl_mem pointer -- the place where the image date on the device is located -- to the kernel.) This only happens with uchar*!! If, for example, I change no host source code, but only the kernel implementation to use, say, uchar4*, float* or int*, I do get the pointer value that I passed as argument to the interop method. How strange is that? (Or is it..?)

Existing ocl methods work, i.e. I tested setTo and threshold. The latter supports CV_8U images and calls a kernel that uses char *, so I think it can't be AMDs OpenCL implementation..(?). I also don't see how OpenCV's kernel signature is different from mine (__global uchar * src)..

I really don't get it. Any help appreciated.