How to use NetBeans 8.2 IDE on ubuntu 16.04 to build and debug CUDA 9.0 code?

How to use NetBeans 8.2 IDE on ubuntu 16.04 to build and debug CUDA code?

Two old threads can be found here: https://devtalk.nvidia.com/default/topic/512566/programming-cuda-in-netbeans-ide/ and here: https://devtalk.nvidia.com/default/topic/384763/cuda-programming-and-performance/ide-for-cuda-using-netbeans-c-c-ide-with-cuda/1, but they are about 10 and 6 years old, respectively. Today, NetBeans is 8.2, ubuntu is 16.04, CUDA is 9.0 and 6 days to year 2018, so I am looking for solution for these new versions.

Thank you for your idea. It’s ok if you are discussing Eclipse.

After hours of exploration, I figured out how to build and debug CUDA program in NetBeans: https://devtalk.nvidia.com/default/topic/1026350/run-cuda-in-netbeans-8-2/?offset=2#5228768. But it is restricted to debugging host code; I still have no idea how to debug kernel code (under Debug mode, NetBeans automatically add -g flag). I would greatly appreciate it if you know how to do it and share your solution with us.