[all-commits] [llvm/llvm-project] b008ea: [CUDA][HIP] Fix device variable linkage

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Fri Feb 5 12:12:28 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b008ea304d438f0aa818918caceb3bd864412304
      https://github.com/llvm/llvm-project/commit/b008ea304d438f0aa818918caceb3bd864412304
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2021-02-05 (Fri, 05 Feb 2021)

  Changed paths:
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/CodeGen/CGCUDANV.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/test/CodeGenCUDA/device-stub.cu
    A clang/test/CodeGenCUDA/device-var-linkage.cu
    M clang/test/CodeGenCUDA/managed-var.cu

  Log Message:
  -----------
  [CUDA][HIP] Fix device variable linkage

For -fgpu-rdc, shadow variables should not be internalized, otherwise
they cannot be accessed by other TUs. This is necessary because
the shadow variable of external device variables are always
emitted as undefined symbols, which need to resolve to a global
symbols.

Managed variables need to be emitted as undefined symbols
in device compilations.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D95901




More information about the All-commits mailing list