This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Target compilation for offloading
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Andrey Turetskiy <andrey dot turetskiy at gmail dot com>
- Cc: iverbin at gmail dot com, michael dot v dot zolotukhin at gmail dot com, Kirill Yukhin <kirill dot yukhin at gmail dot com>, rth at redhat dot com, gcc at gcc dot gnu dot org
- Date: Tue, 29 Oct 2013 10:49:30 +0100
- Subject: Re: [RFC] Target compilation for offloading
- Authentication-results: sourceware.org; auth=none
- References: <CADB16ZApSvg2gMGJTDjQhDmEwxb1y4pyn-k16fhxiV7ZpW46=g at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Oct 29, 2013 at 01:33:17PM +0400, Andrey Turetskiy wrote:
> I wonder how compiler is going to choose which target binaries should
> be created for offload? Will compiler make choice on its own or it is
> the user who should add specific options like --offload-target=...
> How does compiler know paths to target compilers? Will it use
> environment variables or paths will be set during compiler
> configuration?
That needs to be designed. I'd say best would be to allow the default
set of target compilers (if any at all) to be specified during configure,
allow the user to override on the command line and look for the target
compilers using similar mechanism as we use for looking for libraries,
compiler binaries, ld, as etc. in the gcc driver, with possibility to
override it say through GCC specs or -B. Note that also there needs to be
a way to ammend compiler options for the individual targets (already talked
about this earlier in some offloading thread on the mailing list). So,
say if the corresponding host CU is compiled with -O3 -fopenmp -mavx
-mtune=core-avx2, likely you want by default to use -O3 -fopenmp for the
target compilation of the target portion of the CU, but not with the -m*
options, but instead you should be able to specify -mwhatever-else that
is appended after the options copied from the host compilation.
So, I'd like to see that at configure time you specify say that you don't
want any offloading support at all by default, or say mic + ptx (but leave
hsail out), etc., and be able to then say
-foffload-target=mic,hsail -foffload-target-mic=-mbar,-mbaz -foffload-target-hsail=-mfroboz
(what exact strings to use instead of mic and hsail and ptx I guess depends
on what will be the configuration triplets for those).
Jakub