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

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 4 11:19:45 PDT 2023


tra added a comment.

> Initial interactive CUDA support for clang-repl

What should a user expect to be supported, functionality wise? I assume it should cover parsing and compilation. I'm not so sure about the execution. Should it be expected to actually launch kernels, or will that come in a future patch?



================
Comment at: clang/tools/clang-repl/ClangRepl.cpp:137
+
+    ExitOnErr(Interp->LoadDynamicLibrary("libcudart.so"));
+  } else
----------------
v.g.vassilev wrote:
> tra wrote:
> > Is there any doc describing the big picture approach to CUDA REPL implementation and how all the pieces tie together?
> > 
> > From the patch I see that we will compile GPU side of the code to PTX, pack it into fatbinary, but it's not clear now do we get from there to actually launching the kernels. Loading libcudart.so here also does not appear to be tied to anything else. I do not see any direct API calls, and the host-side compilation appears to be done w.o passing the GPU binary to it, which would normally trigger generation of the glue code to register the kernels with CUDA runtime. I may be missing something, too.
> > 
> > I assume the gaps will be filled in in future patches, but I'm still curious about the overall plan.
> > 
> > 
> Hi @tra, thanks for asking. Our reference implementation was done in Cling a while ago by @SimeonEhrig. One of his talks which I think describes well the big picture could be found here: https://compiler-research.org/meetings/#caas_04Mar2021
Cling does ring the bell. The slides from the link above do look OK.



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