Calling a PrimFunc from TVM IR

This is what Taichi supports for basic code composition via ti.func. See for example taichi/python/taichi/examples/simulation/pbf2d.py at master · taichi-dev/taichi · GitHub

I think this is a good first step to improve the usability of TVMScript. Otherwise we have to repeat the same code for different axes etc.

I don’t think mutual function call is needed, just one way is enough (one “main” kernel calling other functions, similar to “global” vs “device” in cuda. Of course a “device” function should also be able to call other device functions). Such a simple improvement would go a long way. I believe @wrongtest’s ask can be met by this.

1 Like