Now pushed as r15-4298-g3269a722b7a036.
Thanks to Bernhard for some proof reading!
Tobias
Tobias Burnus wrote:
Anyone feeling like reviewing this patch? (Mainly the Fortran side?!?)
— Or should I declare it as OpenMP/(OpenACC) patch and just commit it?
→ https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664985.html
Tobias
Tobias Burnus write:
I forgot to update the subject line. To make it easier to find (patch
archeology), now with proper subject line …
Tobias Burnus wrote:
Sometimes waiting a bit leads to better code …
Tobias Burnus wrote:
...
[I guess, we eventually want to add support for more builtins. For
instance, acc_on_device would be a candidate, but I could imagine
some additional builtins.]
I have now implemented acc_on_device and I think the new fix-up
function is way is nicer.
Thus, this patch does:
* (v1) Fix omp_is_initial_device → do only replace when used in
calls (and not when used as function pointer/actual to a dummy
function) + fix ICE due to integer(4) != logical(4) in the middle end.
* (new) For OpenACC, use a builtin for acc_on_device + actually do
compile-time optimization when offloading is not configured.
* (new) libgomp.texi: Typo fixes accumulated, fix wording, and for
acc_on_device, add a note that compile-time folding may be done (and
how it can be disabled).
For OpenACC, I now mix compile time folding vs. runtime to ensure
that it works.
Tested on x86-64 without and with offloading configured, running
with nvptx offloading.
Code review, comments, suggestions, remarks?
Tobias
PS: The testsuite/libgomp.oacc-c-c++-common/routine-nohost-1.c
example is not completely clear to me; however, the new optimization
causes that without offloading enabled, the dump message is not
shown. I tried to understand it better with
-fno-builtin-acc_on_device, but that then caused link errors as the
device function wasn't optimizated away, leaving me puzzled. — At
the end, I just changed the dg-* and did not try to understand the
issue.