[PATCH] D86376: [HIP] Emit kernel symbol

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 1 09:51:38 PST 2021


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

So, to summarize how the patch changes the under-the-hood kernel launch machinery:

- device-side is unchanged. Kernel function is generated with the real kernel name
- host-side stub is still generated with the `__device_stub` prefix.
- host-side generates a 'handle' variable with the kernel function name, which is a pointer to the stub.
- host-side registers the `handle variable` -> `device-side kernel name` association with the HIP runtime.
- the address of the handle variable is used everywhere where we need a kernel pointer on the host side. I.e. passing kernel pointers around, referring to kernels across TUs, etc.
- `<<<>>>` becomes an indirect call to a `__device_stub` function using the pointer retrieved from the handle.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86376/new/

https://reviews.llvm.org/D86376



More information about the cfe-commits mailing list