[PATCH] D80858: [HIP] Support accessing static device variable in host code

2020-07-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 10 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Driver/Action.h:216 const llvm::opt::Arg &Input; - + unsigned Id; virtual void anchor(); rjmccall wrote: > Allowing an arbitrary string might be more ad

[PATCH] D80858: [HIP] Support accessing static device variable in host code

2020-06-01 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. In addition to everyone else's concerns about generating this number randomly, it's also inherently less testable. I'm sure there's something else you could use that's reasonably likely to be unique, like a hash of the input filename or output filename or a combination

[PATCH] D80858: [HIP] Support accessing static device variable in host code

2020-06-01 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In D80858#2067537 , @JonChesterfield wrote: > The value is based on llvm::sys::Process::GetRandomNumber(). So unless one > provides a build-system-derived uuid for every compilation unit, recompiling > identical source will yield an

[PATCH] D80858: [HIP] Support accessing static device variable in host code

2020-06-01 Thread Jon Chesterfield via Phabricator via cfe-commits
JonChesterfield added a comment. The value is based on llvm::sys::Process::GetRandomNumber(). So unless one provides a build-system-derived uuid for every compilation unit, recompiling identical source will yield an observably different binary. The distinction between 'unique' and 'random' is s

[PATCH] D80858: [HIP] Support accessing static device variable in host code

2020-05-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. nvcc supports accessing file-scope static device variables in host code by host APIs like cudaMemcpyToSymbol etc. HIP let users access device variables in host code by shadow variables. In host compilation, clang emits a shado