CUDA 6.5 Unified Memory(cudaMallocManaged()) for copying image

Hello,
I have been trying to use the unified memory to copy an image which is read using opencv into a structure in unified memory using cudaMallocManaged(). For this I wrote a structure in whose constructor I used cudaMallocManaged(), then I used memcpy to copy the data from Mat to my structure allocated memory.I am facing a problem when I am trying to launch a kernel.could anyone please give me an example of how to launch a kernal for an image.

Thanks in advance.

There are various CUDA sample codes that demonstrate launching a kernel to process an image.

http://docs.nvidia.com/cuda/cuda-samples/index.html#imaging

Also, it’s recommended to use proper CUDA error checking any time you are having trouble with a CUDA code. Most of the CUDA sample codes demonstrate proper CUDA error checking.