[all-commits] [llvm/llvm-project] f38a9e: [CUDA] Allow local static variables with target at...

Artem Belevich via All-commits all-commits at lists.llvm.org
Mon Nov 2 14:38:30 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f38a9e51178add132d2c8ae160787fb2175a48a4
      https://github.com/llvm/llvm-project/commit/f38a9e51178add132d2c8ae160787fb2175a48a4
  Author: Artem Belevich <tra at google.com>
  Date:   2020-11-02 (Mon, 02 Nov 2020)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    M clang/test/CodeGenCUDA/static-device-var-no-rdc.cu
    M clang/test/SemaCUDA/bad-attributes.cu
    M clang/test/SemaCUDA/device-var-init.cu

  Log Message:
  -----------
  [CUDA] Allow local static variables with target attributes.

While CUDA documentation claims that such variables are not allowed[1], NVCC has
been accepting them since CUDA-10.0[2] and some headers in CUDA-11 rely on this
working.

1. https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#static-variables-function
2. https://godbolt.org/z/zsodzc

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




More information about the All-commits mailing list