[PATCH] D86376: [HIP] Emit kernel symbol
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 9 07:14:14 PST 2021
yaxunl added a comment.
Actually there is one issue with this approach.
HIP have API's to launch kernels, which accept kernel as function pointer argument. Currently when taking address of kernel, we get the stub function. These kernel launching API's will not work if we use kernel symbol to register the kernel. A solution is to return the kernel symbol instead of stub function when taking address of the kernel in host compilation, i.e. if a function pointer is assigned to a kernel in host code, it gets the kernel symbol instead of the stub function. This will make the kernel launching API work.
To keep the triple chevron working, the kernel symbol will be initialized with the address of the stub function. For triple chevron call, the address of the stub function is loaded from the kernel symbol and invoked.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86376/new/
https://reviews.llvm.org/D86376
More information about the cfe-commits
mailing list