[PATCH] D146389: [clang-repl][CUDA] Initial interactive CUDA support for clang-repl

Simeon Ehrig via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 4 12:10:42 PDT 2023


SimeonEhrig added inline comments.


================
Comment at: clang/tools/clang-repl/ClangRepl.cpp:135
+        std::move(CI), std::move(DeviceCI), OffloadArch,
+        "/tmp/clang-repl.fatbin"));
+
----------------
v.g.vassilev wrote:
> To cover the case where platforms have no `/tmp` we could use `fs::createTemporaryFile`. However, some platforms have read-only file systems. What do we do there?
Actual, we can avoid temporary files completely. The reason, why the fatbinary code is written to a file is the following code in the code generator of the CUDA runtime functions:

https://github.com/llvm/llvm-project/blob/d9d840cdaf51a9795930750d1b91d614a3849137/clang/lib/CodeGen/CGCUDANV.cpp#L722-L732

In the past, I avoided to change the code, because this was an extra Clang patch for Cling.

Maybe we can use the llvm virtualFileSystem: https://llvm.org/doxygen/classllvm_1_1vfs_1_1InMemoryFileSystem.html
But this is just an idea. I have no experience, if this is working for us.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146389/new/

https://reviews.llvm.org/D146389



More information about the cfe-commits mailing list