LuisaGroup/LuisaRender

Is there any way to check the variable values of the DSL while debugging?

Riga27527 opened this issue · 1 comments

I have no way to track the value of the variable after changing it to a DSL variable via def built-in functions. Is there a way to pass the DSL variable to the host?

Hi, @Riga27527

The DSL variables are created on the device and thus cannot be directly visited by the host code. To retrieve their values, generally, you would need to write them to a buffer, download it to a host memory, and then visit the host-side copy.

To make the process easier, we also provide a Printer class in LuisaCompute to help inspect kernel variables. A use case can be found here.