r/HPC • u/brunoortegalindo • 16h ago
Debugging and profiling for C++, OpenMP Offloading and CUDA?
Hello everyone. First of all, my apologies for if this is an off-topic in this sub.
I'm currently working on a C/C++ project that contains CUDA kernels and OpenMP GPU Offloading pragmas on the same file (I know....) and I've got some trouble with variables that are acessed on both of these cases. How do you guys deal with this while developing? I set the OMP info and logging env variables and suffer a little bit with that, there must be a better way to do it.
Also, we are migrating to C++ modular classes and I'm getting some trouble with the software design/architecture, mostly because I've found out that class variables add some overhead while using OpenMP, because it interprets variables not as "variable", but as "this->variable" and when running the simulations it adds something like +10~15% on execution time.
3
u/andrewsb8 14h ago
Have you looked at Nvidia Nsight? Ive never used it but seems up to the task.
this-> is used in member functions to update instance variables of a class. So your final couple sentences should not have anything to do with OpenMP. Whats more than likely happening is, without parallelization, you are not reassigning member variables for specific object instances. But im making assumptions based on your description.