Is invoking a kernel the only way to perform arithmetic operations on device memory?

Hi, everyone! I’m using cuda 3.2.

I’m just curious. Is invoking a kernel the only way to perform arithmetic operations on device memory.

For example, if ‘i’ is an integer on global memory space, I want to increment it by 10. Do I have to launch a kernel for this simple operation?

Thank you!

No, you can also copy it to the host, increment it and write it back.

If you want to avoid launching a kernel for this kind of work the best thing would be to increment it as part of another, larger kernel.