[all-commits] [llvm/llvm-project] 301e23: [CUDA][HIP] Fix static device var used by host cod...

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Wed Sep 23 05:20:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 301e23305d03cfb4004f845a1d9dfdc5e5931fd8
      https://github.com/llvm/llvm-project/commit/301e23305d03cfb4004f845a1d9dfdc5e5931fd8
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2020-09-23 (Wed, 23 Sep 2020)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/test/CodeGenCUDA/static-device-var-no-rdc.cu

  Log Message:
  -----------
  [CUDA][HIP] Fix static device var used by host code only

A static device variable may be accessed in host code through
cudaMemCpyFromSymbol etc. Currently clang does not
emit the static device variable if it is only referenced by
host code, which causes host code to fail at run time.

This patch fixes that.

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




More information about the All-commits mailing list