On Wed, Nov 06, 2013 at 05:11:07PM +0400, Andrey Turetskiy wrote:
> > Let's check my understanding:
> > 1) We can configure gcc with, say, --offload-target=mic,ptx. It means

Note, configure options should be either --with- or --enable- prefixed.
Plus, it is probably better to use configuration triplets there.

Anyway, because the gcc driver contains tons of target dependent stuff too
(paths, plus more importantly specs contents), you want the plugin to
execute the offload target compiler driver rather than just cc1/lto1 etc.,
so you need to find say x86_64-k1om-linux-gcc somewhere (in the same
path as the invoking driver itself, or in some list of further directories
to search, or with -B being a possible override for that).

> > that after build and install we have 3 compilers: for host, for mic
> > and for ptx. In general case, the number may be less, because one
> > compiler may suit more than one target/host (e.g.when host and one of
> > the targets both x86). All compilers are located together in 'prefix'
> > directory, so host compiler will find target gcc there just by name.
> > 2) Also, we can set option -foffload-target=hsail -B<path to
> > gcc_hsail>. It tells gcc to create offload binary for hsail too,
> > besides mic and ptx we've selected in configure. Hsail compiler should
> > be installed separately and can be found by name in directory we set
> > in '-B' option. If there is no right compiler there and in 'prefix'
> > directory, gcc throws error.
> >
> > The thing which is not quite clear for me is your way of compiler
> > options ammending. For example, I want to use knc compiler for offload
> > on mic, so target name is something like x86_64-k1om-linux. However, I
> > don't want to select offload target during configuration, I just use
> > compiler option: -foffload-target=x86_64-k1om-linux. How will gcc

I don't see actually how it would work, because if you don't configure
your primary compiler for x86_64-k1om-linux offload target, then libgomp
plugin wouldn't be built and you couldn't use it even if you managed to
embed it.  And, to build the offload target libgomp plugin, you probably
want to have the offload target compiler already around, because you need
to embed it's modified copy of libgomp etc. into the plugin (one that will
actually act as offload target libgomp, return is_initial_device false, etc.
etc. - unless we propagate the fact that it is offload libgomp somehow,
through env var, something else, but still you probably want to embed it).

        Jakub

Reply via email to