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

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.

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.