[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 6 14:24:20 PDT 2020
tra added inline comments.
================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6069
+ llvm::raw_ostream &OS) const {
+ OS << ".static." << getLangOpts().CUID;
+}
----------------
I suspect that will have interesting issues if CUID is an arbitrary user-supplied string. We may want to impose some sort of sanity check or filtering on the cuid value. Considering that it's a CC1 flag, it's not a critical problem, but some safeguards would be useful there, too. Should we limit allowed character set?
================
Comment at: clang/test/Driver/hip-cuid.hip:35
+// RUN: --offload-arch=gfx906 \
+// RUN: -c -nogpulib -cuid=abcd \
+// RUN: %S/Inputs/hip_multiple_inputs/a.cu \
----------------
Nit: `abcd` could potentially match the value generated by hash. I'd change it to contain characters other than hex.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80858/new/
https://reviews.llvm.org/D80858
More information about the cfe-commits
mailing list