[PATCH] D102237: [CUDA][HIP] Fix non-ODR-use of static device variable

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 19 13:05:13 PDT 2021


yaxunl added a comment.

In D102237#2767538 <https://reviews.llvm.org/D102237#2767538>, @tra wrote:

> Here's a slightly simpler reproducer: https://godbolt.org/z/rW6P9e37s

I have a fix for this: https://reviews.llvm.org/D102801

It seems the issue was due to clang emits the implicit constant variable `aw<ar>::c` but it is invalid to be emitted on device side since it is initialized with a host function pointer. The fix is not to force emit implicit constant variables in device compilation. This basically limits our previous fix to explicit device variables.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102237



More information about the cfe-commits mailing list