taichi
taichi copied to clipboard
[AOT] Do not re-JIT if the kernel has been added to the AOT module already
Describe the bug
If a kernel has been added to an AOT module multiple times, it should only be JIT once. While I found this problem for taichi kernels, we should also check for fields.
To Reproduce
Repro platform: macOS + Metal backend
m = ti.aot.Module(ti.metal)
m.add_kernel(foo)
m.add_kernel(foo)
This isn't a v1.1.0 blocker so I'll remove it from the milestone for now.