Hi Adi,

On 31.03.23 14:35, Prasad, Adi wrote:
Rework lto-wrapper so that if the separate host process target is
enabled, it finds and calls a mkoffload for the host architecture
instead of looking for an offloading compiler’s mkoffload; then write
a mkoffload tool for a separate host process.

Note that multiple offload targets are possible. For instance, on
Debian/Ubuntu, 'gcc -v' shows:
'OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa' and lto-wrapper then
cycles through those, finding the offloading compiler in
$PATH/accel/<triple>/mkoffload

Example: x86_64-none-linux-gnu/12.2.1/accel/amdgcn-amdhsa/mkoffload

Thus, if you install it to 'x86_64-none-linux-gnu' and add it to
OFFLOAD_TARGET_NAMES,* it will work; albeit, we probably want to have
some special handling in gcc.cc to avoid host-process offloading by
default and permit something like -foffload=host instead of having to
specify -foffload=x86_64-none-linux-gnu

(For those flags, see
https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-foffload )

(* it is automatically when adding it to --enable-offload-targets=...
when configuring the non-offloading compiler.)

3. Write a libgomp plugin for separate host processes
4. Document changes, certify Developer Certificate of Origin, produce
a ChangeLog etc according
tohttps://gcc.gnu.org/wiki/GettingStarted#Tutorials.2C_HOWTOsandhttps://gcc.gnu.org/contribute.html#patches
I think it would be useful to start posting patches early – such that
they can be reviewed and discussed. Thus, this is not really the 4th and
5th item.
5. Submit to the mailing list and respond to any requests for changes
* * *

One thing I was wondering that I may be missing - the offloading docs
state that the patch for adding the Intel MIC target have a “runtime
offloading library” called Intel MIC. I haven’t been able to figure
out the purpose of this (my best guess is it’s used to implement the
libgomp plugin?), and whether it’s Intel-specific or needed for
multiple targets.

There used to be Intel MIC support – which effectively only used a
simulator, similar to what this project is about, but this time it is
supposed to be generic and not as narrowly focused as the Intel MIC
stub/simulator/target support.

(Intel MIC support was removed.)

Finally, I was wondering if, having built and tested GCC, there are
now any patches, tests, or docs that I can work on?

For offloading tests, see libgomp/testsuite/ for OpenMP and OpenACC -
albeit for OpenMP, only those tests with 'omp target' actually use
offloading, which can be hostfall back.

They can be run as "make check-target-libgomp" (in the build dir) or by
"cd x86_64-none-linux-gnu/libgomp; make check" – and specific tests can
be run by setting, e.g., RUNTESTFLAGS="fortran.exp" or
RUNTESTFLAGS="c.exp=target-11.c" or ...

No quick idea for work items – maybe I get one – or Thomas does :-)

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955

Reply via email to