Ask Your Question
0

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

asked 2013-09-04 01:45:59 -0600

decision gravatar image

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.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-09-06 06:59:24 -0600

decision gravatar image

I'm pretty sure now it's a bug in AMDs OpenCL debugger, which showed the pointer as being null.. Duh.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-09-04 01:45:59 -0600

Seen: 527 times

Last updated: Sep 06 '13