<div dir="ltr">Hi Jonas,<div><br></div><div>The clang-offload-bundler does not look like it uses the ELF sections (both the version of trunk and Ykt), it looks like it just concatenate the object files into one file, but I might be wrong or if not hopefully this will be changed later.</div><div>At the moment, even though offloading to GPUs is not working on Clang, the driver seems like is doing something different than any other compiler.</div><div>I cced Doru, maybe he can add more about this.</div><div><br></div><div>I am just asking because we are going to add GPUs support on Flang and of course we want to keep clang and flang compatible.</div><div><br></div><div>Thanks.</div><div>Simone</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 11, 2018 at 1:00 PM, Jonas Hahnfeld <span dir="ltr"><<a href="mailto:hahnjo@hahnjo.de" target="_blank">hahnjo@hahnjo.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Simone,<br>
<br>
the same answers as always:<br>
1. Offloading to GPUs is not yet working with Clang trunk.<br>
2. Most of this has already been discussed on the mailing list or described in publications. In short, clang-offload-bundler should also use ELF sections for object files. And AFAIK, IBM XL uses the same mechanisms in most cases.<br>
<br>
Jonas<div><div class="h5"><br>
<br>
Am 2018-01-11 19:15, schrieb Simone Atzeni via cfe-dev:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi all,<br>
<br>
I have been playing with the clang driver to see how it performs the<br>
compilations for an OpenMP program with target offloading (for NVidia<br>
GPU).<br>
<br>
I noticed the use of the tool 'clang-offload-bundler' which seems to<br>
bundle together the object files for the host and for the device.<br>
In particular, if I use -c my foo.o will be a bundle of foo-x86_64.o<br>
and foo-cuda.o, and at link time it will unbundle the foo.o to obtain<br>
back the two object files.<br>
<br>
Now, if I put my foo.o for example in a static library clang does not<br>
work because it does not know how to unbundle the object files from<br>
the library.<br>
<br>
Other compilers, such as IBM XL create a specific section in the ELF<br>
to store the device code, in this way we always have one object file<br>
and there is no need to bundle/unbundle.<br>
Also if a object file/library was compiled with XL it can not be<br>
linked with clang and/or viceversa.<br>
<br>
So, am I doing something wrong, or is this the status of the clang<br>
driver?<br>
Is the clang-offload-bundler the official choice to manage device<br>
code?<br>
If my analysis is correct, what's the workaround?<br>
<br>
Thanks!<br>
Best,<br>
Simone<br></div></div>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote>
</blockquote></div><br></div>