loopy icon indicating copy to clipboard operation
loopy copied to clipboard

[codegen, bug]: Callee kernel name generation is incorrect

Open kaushikcfd opened this issue 4 years ago • 1 comments

Kernel call sites assume that the name of the generated function is identical to the LoopKernel's name. However, the actual name of the non-entrypoint kernel is generated during linearization as

https://github.com/inducer/loopy/blob/f67b65ccb7b377430986cf59db0747e51dfe84e7/loopy/schedule/device_mapping.py#L35-L40


Two ways of fixing this:

  1. For non-entrypoint kernels we should always emit CallKernel with name equal to its LoopKernel, OR,
  2. While emitting the code for a Call expression node, query the translation unit to get its CallKernel.

I feel (1) is cleaner(+easier to implement) and seems like it doesn't make any assumption that might bite us in the future. Opinions?

kaushikcfd avatar Oct 06 '21 19:10 kaushikcfd

Yep, agree the the name should be decided once and then not messed with.

inducer avatar Oct 06 '21 19:10 inducer