<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><span class="pl-c1">Dear LLVM-Developers,<br>
<br>
we extend the cling C++ interpreter
(<a class="moz-txt-link-freetext" href="https://github.com/root-project/cling">https://github.com/root-project/cling</a>) with CUDA functionality
for Nvidia GPUs.</span></p>
<p><span class="pl-c1"> Now we are refactoring the extension
(<a class="moz-txt-link-freetext" href="https://github.com/root-project/cling/pull/284">https://github.com/root-project/cling/pull/284</a>) to fix some
conceptual errors and improve performance. One of our goals is
to avoid file I/O. We have achieved this goal with one
exception. We need to write the CUDA fatbinary code to a file
because the CodeGen of the CUDA x86 backend uses a file path and
uses llvm::MemoryBuffer::getFileOrSTDIN() to load the code from
a file. See:
<a class="moz-txt-link-freetext" href="https://github.com/llvm/llvm-project/blob/9487963244e4c805cf0f5798d903bdb10012b59d/clang/lib/CodeGen/CGCUDANV.cpp#L501-L502">https://github.com/llvm/llvm-project/blob/9487963244e4c805cf0f5798d903bdb10012b59d/clang/lib/CodeGen/CGCUDANV.cpp#L501-L502</a></span></p>
<p><span class="pl-c1">Our question is, can we pass the fatbinary
code to CodeGen without file I/O and without changing the source
code of clang? We want to avoid changes in the clang code, as it
would make it more complicated to update clang/LLVM base. Maybe
something is possible with the llvm virtual file system.
Unfortunately, I am not familiar </span><span class="pl-c1"><span
class="pl-c1">enough</span> with it to find a solution.<br>
</span></p>
<p>Thank you so much for your help.</p>
<p>Best regards,<br>
Simeon Ehrig<br>
</p>
</body>
</html>