Can we get the cuda code when running in gpu backend

As the manual says “The C backend of Taichi allows you to export Taichi kernels to C source.” Can we get the cuda code(.cu file) when running Taichi kernels in gpu backend?

In fact, the CUDA backend is based on LLVM therefore no .cu source is generated. But we may obtain the LLVM IR code of kernels by specifying some initialization arguments:

ti.init(arch=ti.cuda, print_kernel_llvm_ir=True)

We may ask @yuanming for more details.

1 个赞

Got it, thanks.