How do you debug your custom C++ operators?

Hi TD community,

I’ve been developing a custom POP in C++ using Visual Studio for the past two months, trying to write some custom CUDA kernels for computation.

Developing speed is…well, low, mostly because of the many TD crashes and freezes happening while trying stuff out. Apart from debug prints in console and endless tweak-rebuild-restart cycles, I don’t really get how to valuably use the VS Debugger (despite knowing how a debugger works, what breakpoints are, watching, etc), and what I mean by that is: when the program freezes it usually means inspected variables/instances will just not update. Especially since I’m working with pointers and array data (ofc leading to many, many invalid pointers), do you have any suggestions/workflows/additional tools you happen to use?

Any help appreciated :))

Hey,

If you are getting freeze due to a GPU hang, that’s a very tricky thing to track down in general. You can however attach the debugger to the TouchDesigner.exe process, and you’ll be able to put breakpoints in your .C files and it’ll break there. You ofcourse won’t see the code from our binaries, but you’ll be able to step through your code to see what is happening there, and hopefully find issues with unexlect variable values/states along the way. It can also allow you to put breakpoints add error checks that you get out of SDKs/APIs you may be calling.