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

Reply via email to