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: [url]Programming CUDA in Netbeans IDE - CUDA Programming and Performance - NVIDIA Developer Forums and here: [url]IDE for CUDA Using Netbeans C/C++ IDE with CUDA - CUDA Programming and Performance - NVIDIA Developer Forums, 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: [url]Run Cuda in NetBeans 8.2 - CUDA Programming and Performance - NVIDIA Developer Forums. 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.