taichi
taichi copied to clipboard
Use pprintpp to offer Python-style printf in Taichi scope
Concisely describe the proposed feature
Currently, print()
works differently in Python and Taichi scopes. In Taichi scopes, the format part is merely discarded.
Describe the solution you'd like (if any) Projects like pprintpp provide Pythonic printf in C++, and can be used in Taichi.
Related issues: #5949 #5972
Hey @lucifer1004 ! Thanks for the feature request! IIUC pprintpp-like support is feasible on cpu backend, but for backends like cuda/vulkan printing actually happens on device and we'll mostly limit to what they support. For example "%s" is not supported on vulkan :P so it does require some tweaks for each backend to support them. Btw we currently partially support f-string since we does the parsing in python preprocessing ;)