[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-12 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Ah, too bad. Is there any way to suppress that in debug info? I'm not sure there's any other way to satisfy the competing requirements here, and if it's not going to be consistent, it'd be better to avoid the complexity of mangling the thunk differently. CHANGES

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1975822 , @rjmccall wrote: > Is the renaming just being done to avoid breakpoints from triggering in the > stub? Can you not disable debugging the stub using whatever mechanism > `__attribute__((nodebug))` uses? I

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-11 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. Is the renaming just being done to avoid breakpoints from triggering in the stub? Can you not disable debugging the stub using whatever mechanism `__attribute__((nodebug))` uses? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77743/new/

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. The ambiguity issue is still there. That `__global__` function generates different code if it's compiled as HIP by clang or non-HIP code by clang or other compilers. That will break the resolving from the symbol value to its device kernel name. CHANGES SINCE LAST

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1972301 , @hliao wrote: > In D77743#1972298 , @yaxunl wrote: > > > In D77743#1972292 , @hliao wrote: > > > > > In addition, we may also

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D77743#1972298 , @yaxunl wrote: > In D77743#1972292 , @hliao wrote: > > > In addition, we may also need to extend the registration to set up the > > mapping from that global variable to

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1972292 , @hliao wrote: > In addition, we may also need to extend the registration to set up the > mapping from that global variable to the host side stub function. > `hipKernelLaunch` (implemented as a function call

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In addition, we may also need to extend the registration to set up the mapping from that global variable to the host side stub function. `hipKernelLaunch` (implemented as a function call instead of the kernel launch syntax) to call into that stub function to prepare the

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1972258 , @hliao wrote: > In D77743#1970304 , @tra wrote: > > > In D77743#1970163 , @yaxunl wrote: > > > > > The kernel handle is a

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao requested changes to this revision. hliao added a comment. This revision now requires changes to proceed. In D77743#1970304 , @tra wrote: > In D77743#1970163 , @yaxunl wrote: > > > The kernel handle is a

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-08 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. In D77743#1970163 , @yaxunl wrote: > The kernel handle is a variable. Even if it has the same name as kernel, it > is OK for the debugger since the debugger

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1970035 , @tra wrote: > Would not this scheme create a conflict between the device-side mangled > kernel name and the handle which we emit with the same name? I recall that > the distinct stub name was introduced

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-08 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. Would not this scheme create a conflict between the device-side mangled kernel name and the handle which we emit with the same name? I recall that the distinct stub name was introduced specifically to avoid confusion between device-side kernel and the host-side stub that

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. HIP provide host API to allow C/C++ programs to launch kernel. A C/C++ program can declare a HIP kernel as an external function and pass it to the kernel launching API. When linked with object files built from HIP programs.