[cfe-dev] [RFC][OpenMP][CUDA] Unified Offloading Support in Clang Driver

Justin Lebar via cfe-dev cfe-dev at lists.llvm.org
Thu Mar 10 10:59:26 PST 2016


> Justin, is this convincing enough?

Okay, okay.  Uncle.

There are two things here that I find convincing.

1) Although we're not going to be compatible with the details of some,
if not all, other compilers' formats, we can at least be compatible
with the spirit by using object files as opposed to tar.

2) The postscript in Andrey's e-mail:

> Re: objdump doesn't understand ELF format with code for multiple targets. The same is true for fat executable files as well, isn't? So if we need to teach objdump how to recognize fat files, we already have this problem.

It's probably much more important that objdump work on executables
than on object files, since if you have object files, you can probably
recompile with -save-temps, but if you only have an executable, you
don't necessarily have access to intermediate files, or even a
compiler for the relevant architecture, much less the specific
compiler which generated the executable.

Shoving device code into the host *executable* seems unavoidable.  I'm
still not thrilled with doing the same for object files -- it still
feels like we're using ELF when we actually want an archive format --
but (1) makes it less bad.

-Justin

On Wed, Mar 9, 2016 at 5:59 AM, Andrey Bokhanko
<andreybokhanko at gmail.com> wrote:
> All,
>
> I asked Intel GCC guys who implemented OpenMP offloading support in GCC, and
> as they told me, GCC also employs option #4 from Hal's list -- it puts both
> host and target code in a single ELF file. "Code" in GCC case is always
> GCC's IR (Gimple), though -- they require GCC invocation from linker in
> order to produce a multi-target executable. This makes GCC non-interoperable
> with any other offloading compiler and effectively produces its own
> standard.
>
> Thus, prior art from:
> * nvcc
> * Pathscale
> * GCC
> * ICC
>
> indicates only one direction -- compiler driver produces a single object
> file with target code embedded in data section.
>
> Justin, is this convincing enough? I don't see any good reasons why clang
> should go against what every other compiler on the planet does.
>
> Re: objdump doesn't understand ELF format with code for multiple targets.
> The same is true for fat executable files as well, isn't? So if we need to
> teach objdump how to recognize fat files, we already have this problem.
>
> Yours,
> Andrey
> =====
> Software Engineer
> Intel Compiler Team
>
>



More information about the cfe-dev mailing list