سؤال

is there any good way the debug the kernel function when programming on GPU?

The way I use is using printf(...) or copy the result back to CPU and then look on them.

I find it is too time-consuming to debug.

I appreciate your advice. Thank you.

هل كانت مفيدة؟

المحلول

If you're on Windows, be sure to try NVIDIA Parallel Nsight (official debug tool from Nvidia)

نصائح أخرى

What about using a debugger?

If you are on windows you can use the VisualStudio Debugger . If you are on linux (better) you can use cuda-gdb.

The typical way to create a proper kernel is:

first implement the straightforward algorithm for the cpu only. then start with the simplest possible way of creating your kernel, upload/download data and compare the result of this first simple kernel to the results of the correct cpu kernel.

Then start add complexity and create new version of the kernel.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top