[Openmp-commits] [PATCH] D102691: [AMDGPU][Libomptarget] Remove global KernelNameMap

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu May 20 08:19:04 PDT 2021


JonChesterfield added a comment.

Taken a closer look at this. Cut down example msgpack,

  ".name" : "__omp_vmul_l8",
  ".symbol" : "__omp_vmul_l8.kd",

Most things use the 'name' version, i.e. without the trailing .kd suffix. The symbol name passed into the openmp runtime is that one, and that's the form used as a key in KernelInfoTable.

The HSA functions expect the suffixed version, and that's the one SYMBOL_INFO_NAME returns.

So what we presently do is:

- Build a map from foo.kd to foo
- Check, obliquely, that the original metadata had both foo.kd and foo present
- Use that map to strip .kd from the result of a HSA call

The logic to drop a trailing .kd therefore looks like the right change to make. We can check the .name and .symbol fields when reading the metadata and error out if they don't match the expected format, and likewise error out if HSA returns a string that doesn't end .kd, and at that point we can rip out the map.

That's close to the patch as written above, but now I've actually worked through the control flow myself as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102691



More information about the Openmp-commits mailing list