Re: [Patch, PR Fortran/90072] Polymorphic Dispatch to Polymophic Return Type Memory Leak

2024-06-08 Thread Tobias Burnus
Andre Vehreschild wrote: PS That's good news about the funding. Maybe we will get to see "built in" coarrays soon? You hopefully will see Nikolas work on the shared memory coarray support, if that is what you mean by "built in" coarrays. I will be working on the distributed memory coarray

Re: [wwwdocs] gcc-15/changes.html + projects/gomp: update for new OpenMP features

2024-06-08 Thread Tobias Burnus
Hi Gerald, Gerald Pfeifer wrote: Looks like a janitorial task to fix the absolute links, possibly excluding those with /git, /onlinedocs, /wiki – or assuming that the main page is GCC.gnu.org, relying on the redirects. It's on my list. A first quick check indicates there isn't much to do,

Re: [wwwdocs] gcc-15/changes.html + projects/gomp: update for new OpenMP features

2024-06-06 Thread Tobias Burnus
Hi Gerald, Gerald Pfeifer wrote: +++ b/htdocs/gcc-15/changes.html + + https://gcc.gnu.org/projects/gomp/;>OpenMP Can you please make this a relative link, i.e. "../projects/gomp/"? Good point. I thought such links should be absolute because of (www.)GNU.org, i.e.

Re: [committed] nvptx, libgfortran: Switch out of "minimal" mode

2024-06-06 Thread Tobias Burnus
Sandra Loosemore wrote: On 6/6/24 06:06, Tobias Burnus wrote: +@item I/O within OpenMP target regions and OpenACC compute regions is supported +  using the C library @code{printf} functions. +  Additionally, the Fortran @code{print}/@code{write} statements are +  supported within

Re: [committed] nvptx, libgfortran: Switch out of "minimal" mode

2024-06-06 Thread Tobias Burnus
Hi Thomas, regarding the commit r15-1070-g3a4775d4403f2e / https://gcc.gnu.org/r15-1070 First, thanks for adding I/O support to nvptx offloading. I have a wording nit, to be confirmed by a native speaker: --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi ... +@item I/O within OpenMP

Re: [PATCH v4 1/5] libgomp, openmp: Add ompx_pinned_mem_alloc

2024-06-06 Thread Tobias Burnus
Hi Andrew, hi Jakub, hello world, Andrew Stubbs wrote: Compared to the previous v3 posting of this patch, the enumeration of the "ompx" allocators have been moved to start at "100" 100 is a bad value - as can be seen below. As Jakub suggested at

[wwwdocs] gcc-15/changes.html + projects/gomp: update for new OpenMP features

2024-06-06 Thread Tobias Burnus
GCC 15 now supports unified-shared memory and the tile/unroll constructs in OpenMP. Updates https://gcc.gnu.org/gcc-15/changes.html and https://gcc.gnu.org/projects/gomp/ Comments? Tobias gcc-15/changes.html + projects/gomp: update for new OpenMP features GCC 15 now supports unified-shared

*ping* – Re: [wwwdocs] gcc-15/changes.html (nvptx): Constructors are now supported

2024-06-05 Thread Tobias Burnus
Regarding https://gcc.gnu.org/pipermail/gcc-patches/2024-June/653417.html , are there any … Tobias Burnus wrote: Comments or fine as is? Tobias

Re: [patch] libgomp: Enable USM for some nvptx devices

2024-06-05 Thread Tobias Burnus
with mainline's USM being much slower with ~30% than OG13 with 12%. Tobias Burnus wrote: I have now tried it on my laptop with BabelStream,https://github.com/UoB-HPC/BabelStream Compiling with: echo "#pragma omp requires unified_shared_memory" > omp-usm.h cmake -DMODEL=omp -DCMAKE_CXX_C

Re: [patch] libgomp: Enable USM for some nvptx devices

2024-06-04 Thread Tobias Burnus
Andrew Stubbs wrote: PS: I would love to do some comparisons [...] Actually, I think testing only data transfer is fine for this, but we might like to try some different access patterns, besides straight linear copies. I have now tried it on my laptop with

Re: [patch] libgomp: Enable USM for some nvptx devices

2024-06-03 Thread Tobias Burnus
Andrew Stubbs wrote: On 03/06/2024 17:46, Tobias Burnus wrote: Andrew Stubbs wrote: +    /* If USM has been requested and is supported by all devices +   of this type, set the capability accordingly. */ +    if (omp_requires_mask & GOMP_REQUIRES_UNIFIED_SHARED_ME

Re: [patch] libgomp: Enable USM for some nvptx devices

2024-06-03 Thread Tobias Burnus
Andrew Stubbs wrote: +    /* If USM has been requested and is supported by all devices +   of this type, set the capability accordingly.  */ +    if (omp_requires_mask & GOMP_REQUIRES_UNIFIED_SHARED_MEMORY) +  current_device.capabilities |= GOMP_OFFLOAD_CAP_SHARED_MEM; +

[committed] install.texi (gcn): Fix date of recommended newlib version

2024-06-03 Thread Tobias Burnus
Somehow, I was one year ahead. The commit wasn't 2025-03-25 but in 2024. Committed as obvious, also to avoid future confusions. Tobias commit 16fb3abf0fb4b88ee0e27732db217909fa429a81 Author: Tobias Burnus Date: Mon Jun 3 12:56:39 2024 +0200 install.texi (gcn): Fix date of recommended

Re: [patch] install.texi (nvptx): Recommend nvptx-tools 2024-05-30

2024-06-03 Thread Tobias Burnus
Richard Biener wrote: install.texi also has the issue that it's not pre-packaged in a easy to discover and readable file in the release tarballs and that the online version is only for trunk. I always wondered why it is not included at https://gcc.gnu.org/onlinedocs/ — it would then also be

Re: [patch] install.texi (nvptx): Recommend nvptx-tools 2024-05-30

2024-06-03 Thread Tobias Burnus
Richard Biener wrote: On Mon, 3 Jun 2024, Tobias Burnus wrote: Thomas Schwinge wrote: In the following, I have then reconsidered that stance; we may actually "Implement global constructor, destructor support in a conceptually simpler way than using 'collect2' (the program): impl

[wwwdocs] gcc-15/changes.html (nvptx): Constructors are now supported

2024-06-03 Thread Tobias Burnus
Comments or fine as is? Tobias gcc-15/changes.html (nvptx): Constructors are now supported diff --git a/htdocs/gcc-15/changes.html b/htdocs/gcc-15/changes.html index b59fd3be..b3305079 100644 --- a/htdocs/gcc-15/changes.html +++ b/htdocs/gcc-15/changes.html @@ -85,7 +103,14 @@ a

[nvptx] *ping* - [patch] [gcn][nvptx] Add warning to mkoffload for 32bit host code

2024-06-03 Thread Tobias Burnus
Hi Thomas, hi Tom, any comment regarding this patch? https://gcc.gnu.org/pipermail/gcc-patches/2024-April/650007.html Tobias Am 25.04.24 um 12:51 schrieb Tobias Burnus: Motivated by a surprise of a colleague that with -m32, no offload dumps were created; that's because mkoffload does

[patch] install.texi (nvptx): Recommend nvptx-tools 2024-05-30 (was: Re: nvptx target: Global constructor, destructor support, via nvptx-tools 'ld')

2024-06-03 Thread Tobias Burnus
Thomas Schwinge wrote: In the following, I have then reconsidered that stance; we may actually "Implement global constructor, destructor support in a conceptually simpler way than using 'collect2' (the program): implement the respective functionality in the nvptx-tools 'ld'". The latter is

Re: [PATCH v2 01/12] OpenMP: metadirective tree data structures and front-end interfaces

2024-05-31 Thread Tobias Burnus
Hi Sandra, some observations/comments, but in general it looks good. Sandra Loosemore wrote: This patch adds the OMP_METADIRECTIVE tree node and shared tree-level support for manipulating metadirectives. It defines/exposes interfaces that will be used in subsequent patches that add front-end

[patch] libgomp.texi: Impl. update for USM and missing 5.2 item

2024-05-29 Thread Tobias Burnus
Now that unified-shared memory works (with some devices), mark it as 'Y' and link to the device-specific chapter. While there is always room for improvement (like having opt-in partial support for managed-memory semi-USM devices), it works sufficienty for a 'Y'. Additionally, I saw that 5.2

[patch] libgomp: Enable USM for AMD APUs and MI200 devices

2024-05-29 Thread Tobias Burnus
This patch depends (on the libgomp/target.c parts) of the patch "[patch] libgomp: Enable USM for some nvptx devices", https://gcc.gnu.org/pipermail/gcc-patches/2024-May/652987.html AMD GPUs that are either APU devices or MI200 [or MI300X] (with HSA_XNACK=1 set) can access host memory; the

Re: [patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-29 Thread Tobias Burnus
Jakub Jelinek wrote: I mean, if we want to add something, maybe better would an -include like option that instead of including a file includes it directly. gcc --include-inline '#pragma omp requires unified_shared_memory' ... Likewise for Fortran, but there the question is whether it should be

Re: [patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-29 Thread Tobias Burnus
Jakub Jelinek wrote: How is that option different from echo '#pragma omp requires unified_shared_memory' > omp-usm.h gcc -include omp-usm.h ? I mean with -include you can add anything you want, not just one particular directive, and adding a separate option for each is just weird. For C/C++,

Re: [patch] libgomp: Enable USM for some nvptx devices

2024-05-29 Thread Tobias Burnus
Tobias Burnus wrote: While most of the nvptx systems I have access to don't have the support for CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, one has: Actually, CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS is sufficient. And I finally also found the proper webpage

[patch] libgomp: Enable USM for some nvptx devices

2024-05-28 Thread Tobias Burnus
While most of the nvptx systems I have access to don't have the support for CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, one has: Tesla V100-SXM2-16GB (as installed, e.g., on ORNL's Summit) does support this feature. And with that feature, unified-shared memory support

[patch] OpenMP: Add -fopenmp-force-usm mode

2024-05-28 Thread Tobias Burnus
-fopenmp-force-usm can be useful for some badly written code. Explicity using 'omp requires' makes more sense but still. It might also make sense for testing purpose. Unfortunately, I did not see a simple way of testing it. When trying it manually, I looked at the 'a.xamdgcn-amdhsa.c'

[Patch] testsuite/*/gomp: Remove 'dg-prune-output "not supported yet"'

2024-05-28 Thread Tobias Burnus
Improve test coverage by removing 'prune-output' given that the features are implemented in the meanwhile. Comments, suggestions? Otherwise I will commit the patch as obvious. Tobias testsuite/*/gomp: Remove 'dg-prune-output "not supported yet"' gcc/testsuite/ChangeLog: *

[wwwdocs][patch] gcc-15/changes.html: Fortran - mention F2023 logical-kind additions

2024-05-28 Thread Tobias Burnus
Let's make https://gcc.gnu.org/gcc-15/changes.html a bit more useful … While there were several useful Fortran commits already, only one seems to be about a new feature. Thus, document selected_logical_kind and the ISO_FORTRAN_ENV additions. Comments or suggestions before I commit it? Tobias

Re: [PATCH 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-05-28 Thread Tobias Burnus
Hi PA, hi all, two remarks while quickly browsing the code: Paul-Antoine Arras: + if (n->sym->ts.type != BT_DERIVED + || !n->sym->ts.u.derived->ts.is_iso_c) + { + gfc_error ("argument list item %qs in " +

Re: [Patch] Fortran: invoke.texi - link to OpenCoarrays.org + mention libcaf_single

2024-05-21 Thread Tobias Burnus
Hi Bernhard, rep.dot@gmail.com wrote: library such as @url{http://opencoarrays.org} needs to be linked. Maybe use https? Works, but as the certificate is not valid, it requires to ignore the errors in a browser, which is a worse user experience. The error is, e.g., "curl: (60) SSL

Re: [Patch] contrib/gcc-changelog/git_update_version.py: Improve diagnostic

2024-05-21 Thread Tobias Burnus
Hi Jakub, Jakub Jelinek wrote: On Mon, May 20, 2024 at 08:31:02AM +0200, Tobias Burnus wrote: Hmm, there were now two daily bumps: [...] I really wonder why. Because I've done it by hand. Okay, that explains it. I still do not understand why it slipped through at the first place; I tried

[Patch] contrib/gcc-changelog/git_update_version.py: Improve diagnostic (was: [Patch] contrib/gcc-changelog/git_update_version.py: Add ignore commit, improve diagnostic)

2024-05-20 Thread Tobias Burnus
pts? Does it ignore the errors? Or what goes wrong here? Any idea? TobiasFrom f56b1764f2b5c2c83c6852607405e5be0a763a2c Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Sun, 19 May 2024 08:17:42 +0200 Subject: [PATCH] contrib/gcc-changelog/git_update_version.py: Improve diagnostic contrib/Chang

[Patch] Fortran: Fix SHAPE for zero-size arrays

2024-05-19 Thread Tobias Burnus
That is for https://gcc.gnu.org/PR115150 – a GCC 12/13/14/15 regression, caused when switching from a libgomp call to inline code and missing the corner case of zero-size arrays ... OK for mainline + all affected branches? Tobias Fortran: Fix SHAPE for zero-size arrays PR fortran/115150

[Patch] Fortran: invoke.texi - link to OpenCoarrays.org + mention libcaf_single

2024-05-19 Thread Tobias Burnus
I noticed that gfortran's coarray support did not link to the http://www.opencoarrays.org/ As that library is needed to support parallelization, it makes sense to have the link. Motivated by someone claiming at ISC-HPC that GCC only supports a single image. And also motivated by Damian's

[Patch] contrib/gcc-changelog/git_update_version.py: Add ignore commit, improve diagnostic

2024-05-19 Thread Tobias Burnus
errors? Or what goes wrong here? Any idea? Tobias From f56b1764f2b5c2c83c6852607405e5be0a763a2c Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Sun, 19 May 2024 08:17:42 +0200 Subject: [PATCH] contrib/gcc-changelog/git_update_version.py: Add ignore commit, improve diagnostic contrib/Chang

[wwwdocs,committed] projects/gomp: Update doc links for GCC 14

2024-05-14 Thread Tobias Burnus
Minor update – to include GCC 14 and update mainline to 15. I also replaced the doc links to the latest release; shouldn't matter for the status but it is nicer nonetheless. Tobias commit 6d76756d2070040c35e7991a626805a736edea1d Author: Tobias Burnus Date: Tue May 14 09:34:47 2024 +0200

[patch] [gcn][nvptx] Add warning to mkoffload for 32bit host code

2024-04-25 Thread Tobias Burnus
Motivated by a surprise of a colleague that with -m32, no offload dumps were created; that's because mkoffload does not process host binaries when the are 32bit (i.e. ilp32). Internally, that done as follows: The host compiler passes to 'mkoffload' the used host ABI, i.e. -foffload-abi=ilp32 or

Re: [wwwdocs] gcc-14/changes.html (AMD GCN): Mention gfx1036 support

2024-04-15 Thread Tobias Burnus
Richard Biener wrote: I do wonder whether hot-patching the ELF header from the libgomp plugin with the actual micro-subarch would be possible to make the driver happy. For completeness, there is also the possibility to play with an environment variable as in HSA_OVERRIDE_GFX_VERSION=9.0.0 or

[wwwdocs] gcc-14/changes.html + projects/gomp/: Fix OpenMP/OpenACC changes section/anchor

2024-04-15 Thread Tobias Burnus
When clicking on the GCC..1x links at https://gcc.gnu.org/projects/gomp/#omp5.0 , I noticed that the GCC 13 and 14 links did not link to the OpenMP changes. It turned out that in GCC 12 and before (see commit message for details), the OpenMP and OpenACC changes are under "New Languages and

[wwwdocs] gcc-14/changes.html (AMD GCN): Mention gfx1036 support

2024-04-15 Thread Tobias Burnus
I experimented with some variants to make clearer that each of RDNA2 and RNDA3 applies to two card types, but at the end I settled on the fewest-word version. Comments, remarks, suggestions? (To this change or in general?) Current version: https://gcc.gnu.org/gcc-14/changes.html#amdgcn

[Patch] Fortran: List-directed read - accept again tab as alternative to space as separator [PR114304] (was: [patch, libgfortran] PR114304 - [13/14 Regression] libgfortran I/O – bogus "Semicolon not a

2024-04-08 Thread Tobias Burnus
Jerry D wrote: See attached updated patch. It turned rather quickly out that this patch – committed as r14-9822-g93adf88cc6744a – caused regressions. Namely, real-world code use tab(s) as separator instead of spaces. [For instance, PR114304 which contains a named-list input file from SPEC

Re: [patch, libgfortran] PR114304 - [13/14 Regression] libgfortran I/O – bogus "Semicolon not allowed as separator with DECIMAL='point'"

2024-04-05 Thread Tobias Burnus
Hi Jerry, hello world, Jerry D wrote: On 4/5/24 10:47 AM, Jerry D wrote: On 4/4/24 2:41 PM, Tobias Burnus wrote: I think for the current testcases, I like the patch – the question is only what's about:    ',3' as input for 'comma'   (or '.3' as input for 'point') [...] But for 'comma

Re: [patch, libgfortran] PR114304 - [13/14 Regression] libgfortran I/O – bogus "Semicolon not allowed as separator with DECIMAL='point'"

2024-04-04 Thread Tobias Burnus
Hi Jerry, I think for the current testcases, I like the patch – the question is only what's about:   ',3' as input for 'comma'   (or '.3' as input for 'point') For 'point' – 0.3 is read and ios = 0 (as expected) But for 'comma': * GCC 12 reads nothing and has ios = 0. * GCC 13/mainline has

[wwwdocs] gcc-14/changes.html: Comment out of empty sections

2024-04-04 Thread Tobias Burnus
I find it confusing to see multiple in a row without content. Actually, both have as content, but those are commented out as actual news is missing ... See https://gcc.gnu.org/gcc-14/changes.html and see the last entry at the bottom of the page and "Operating Systems" somewhere in between.

[wwwdocs] gcc-14/changes.html: Mention OpenACC 2.7's 'readonly' modifier

2024-04-04 Thread Tobias Burnus
Minor OpenACC 2.7 update to https://gcc.gnu.org/gcc-14/changes.html#openacc The 'readonly' modifier is now in (well, since March), albeit more 2.7 features are in the pipeline... Comments, remarks, suggestions before I commit it? Tobias gcc-14/changes.html: Mention OpenACC 2.7's 'readonly'

[wwwdocs,committed] gcc-14/changes.html: Fix HTML syntax

2024-04-04 Thread Tobias Burnus
Found when testing my own change via https://validator.w3.org/nu/#file Committed as obvious. Tobias commit c9e275660a19c804dd8c591c73cb9b169a9d7573 Author: Tobias Burnus Date: Thu Apr 4 22:07:28 2024 +0200 gcc-14/changes.html: Fix HTML syntax W3.org's HTML checker complained

Re: [patch, libgfortran] PR114304 - [13/14 Regression] libgfortran I/O – bogus "Semicolon not allowed as separator with DECIMAL='point'"

2024-04-04 Thread Tobias Burnus
Hi Jerry, Jerry D wrote: The attached log entry and patch (git show) fixes this issue by adding logic to handle spaces in eat_separators. One or more spaces by themselves are a valid separator. So in this case we look at the character following the spaces to see if it is a comma or semicolon.

[wwwdocs] projects/gomp/: Update TR12 status - fix misplaced GCC-14; add new items

2024-04-04 Thread Tobias Burnus
TR12 update: * I misplaced one implemented in GCC 14 in one of the last commits * Same update as just proposed for libgomp.texi: - Renaming of 'coexecute' to 'workdistribute' (Post TR12 change to avoid confusion with Fortran's co_min, co_broadcast, ... intrinsic procedures for

[Patch] libgomp.texi: Update entries in OpenMP TR12 implementation status

2024-04-04 Thread Tobias Burnus
Hi all, this patch updates the OpenMP TR12 status (to-do) items: (a) 'coexecute', added in TR12, was renamed after TR12 to 'workdistribute'. Reason: Feedback that 'co...' reminds of Fortran coarrays and the its intrinsic procedures: co_broadcast, co_max, co_min, co_reduce, co_sum

[Patch] nvptx: In mkoffload.cc, call diagnostic_color_init + gcc_init_libintl

2024-04-03 Thread Tobias Burnus
Nvptx's mkoffload.cc contains 14 'fatal_error' calls and one 'warning_at' call, which stands out more clearly (color, bold) when enabling diagnostic_color_init which this patch does. — Additionally, the call gcc_init_libintl permits that the already translated error messages also show up as

[Patch] lto-wrapper.cc: Add offload target name to 'offload_args' suffix

2024-04-03 Thread Tobias Burnus
Found when working with -save-temps and looking at 'mkoffload' with a GCC configured for both nvptx and gcn offloading. Before (for 'a.out') for mkoffload:a.offload_args now: a.amdgcn-amdhsa.offload_args and a.nvptx-none.offload_args OK for mainline? Tobias PS: The code does not free the

Re: [Patch] GCN: install.texi update for Newlib change and LLVM 18 release

2024-04-03 Thread Tobias Burnus
Hi Jakub, hello world Jakub Jelinek wrote: On Wed, Apr 03, 2024 at 11:09:19AM +0200, Tobias Burnus wrote: @@ -3954,8 +3956,8 @@ on the GPU. To enable support for GCN3 Fiji devices (gfx803), GCC has to be configured with @option{--with-arch=@code{fiji}} or @option{--with-multilib-list

[Patch] GCN: install.texi update for Newlib change and LLVM 18 release

2024-04-03 Thread Tobias Burnus
Update for the GCN Newlib commit 7dd4eb1db "amdgcn: Implement proper locks", https://sourceware.org/git/?p=newlib-cygwin.git;a=commit;h=7dd4eb1db And change future to past tense regarding the LLVM 18 release. OK for mainline? Thanks, Tobias GCN: install.texi update for Newlib change and LLVM

[Patch] GCN: Fix --with-arch= handling in mkoffload [PR111966]

2024-04-03 Thread Tobias Burnus
This patch handles --with-arch= in GCN's mkoffload.cc While mkoffload mostly does not know this and passes it through to the GCN lto1 compiler, it writes an .o file with debug information - and here the -march= in the ELF flags must agree with the one in the other files. Hence, it uses now the

Re: [PATCH] amdgcn: Add gfx1036 target

2024-03-25 Thread Tobias Burnus
Richard Biener wrote: I'll follow up with the libgomp testing test summary for archival purposes. I still see linker errors for testcases using -g (the ld: ^[[0;31merror: ^[[0mincompatible mach: /tmp/ccr0oDpD.mkoffload.dbg.o^M kind) Hmm, odd – can you try compile with -save-temp and look at

Re: [Patch][RFC] GCN: Define ISA archs in gcn-devices.def and use it

2024-03-15 Thread Tobias Burnus
Hi Andrew, Andrew Stubbs wrote: This is more-or-less what I was planning to do myself, but as I want to include all the other features that get parametrized in gcn.cc, gcn.h, gcn-hsa.h, gcn-opts.h, I hadn't got around to it yet. Unfortunately, I think the gcn.opt and config.gcc will always

[Patch][RFC] GCN: Define ISA archs in gcn-devices.def and use it

2024-03-15 Thread Tobias Burnus
Given the large number of AMD GPU ISAs and the number of files which have to be adapted, I wonder whether it makes sense to consolidate this a bit, especially in the light that we may want to support more in the future. Besides using some macros, I also improved the diagnostic if the object

Re: OpenACC 2.7: front-end support for readonly modifier: Add basic OpenACC 'declare' testing

2024-03-14 Thread Tobias Burnus
Hi all, hi Thomas & Chung-Lin, Thomas Schwinge wrote: But I realized another thing: don't we have to handle the 'readonly' modifier also in Fortran module files, that is, next to the OpenACC 'declare' 'copyin' handling in 'gcc/fortran/module.cc': 'AB_OACC_DECLARE_COPYIN' etc.? I bet so; it is

Re: OpenACC 2.7: front-end support for readonly modifier: Add basic OpenACC 'declare' testing

2024-03-14 Thread Tobias Burnus
Hi all, hi Thomas & Chung-Lin, Thomas Schwinge wrote: But I realized another thing: don't we have to handle the 'readonly' modifier also in Fortran module files, that is, next to the OpenACC 'declare' 'copyin' handling in 'gcc/fortran/module.cc': 'AB_OACC_DECLARE_COPYIN' etc.? I bet so; it is

Re: [PATCH v2] openmp: Change to using a hashtab to lookup offload target addresses for indirect function calls

2024-03-14 Thread Tobias Burnus
Hi Kwok, On January 22, 2024, Kwok Cheung Yeung wrote: There was a bug in the declare-target-indirect-2.c libgomp testcase (testing indirect calls in offloaded target regions, spread over multiple teams/threads) that due to an errant fallthrough in a switch statement resulted in only one

Re: [PATCH, OpenACC 2.7] struct/array reductions for Fortran

2024-03-13 Thread Tobias Burnus
Hi Chung-Lin, hi Thomas, hello world, some thoughts glancing at the patch. Chung-Lin Tang wrote: There is still some shortcomings in the current state, mainly that only explicit-shaped arrays can be used (like its C counterpart). Anything else is currently a bit more complicated in the

Re: [PATCH, OpenACC 2.7] Implement reductions for arrays and structs

2024-03-13 Thread Tobias Burnus
Hi Chung-Lin, https://gcc.gnu.org/pipermail/gcc-patches/2024-January/641669.html Chung-Lin Tang wrote: this patch implements reductions for arrays and structs for OpenACC. Following the pattern for OpenACC reductions [...] (Stumbled over while looking at the Fortran patch, but applying to

[committed] libgomp/libgomp.texi: Fix @node order in @menu

2024-03-12 Thread Tobias Burnus
in texinfo. It clearly wasn't done on purpose in GCC, though. Hence: Committed as obvious. Tobias commit ef79c64cb5762c86ee04ddfcedb7fe31eaa3bac8 Author: Tobias Burnus Date: Tue Mar 12 15:42:50 2024 +0100 libgomp/libgomp.texi: Fix @node order in @menu While texinfo 7.0.3 does

Re: [Patch] OpenMP/Fortran: Fix defaultmap(none) issue with dummy procedures [PR114283]

2024-03-12 Thread Tobias Burnus
Jakub Jelinek wrote: So firstprivate clause handling remaps them then if declare target indirect is used? If so, the patch looks reasonable to me. [I have now updated the patch to turn the testcase to ensure that is also keeps works at runtime.] OpenMP leaves it a bit open when the remapping

[Patch] OpenMP/Fortran: Fix defaultmap(none) issue with dummy procedures [PR114283]

2024-03-11 Thread Tobias Burnus
Using dummy procedures in a target region with 'defaultmap(none)' leads to: Error: 'g' not specified in enclosing 'target' and this cannot be fixed by using 'firstprivate' as non-pointer dummy routines are rejected as "Error: Object 'g' is not a variable". Fixed by doing the same for mapping

Re: Fix 'char' initialization, copy, check in 'libgomp.oacc-fortran/acc-memcpy.f90'

2024-03-08 Thread Tobias Burnus
Hi Thomas, Am 08.03.24 um 12:15 schrieb Thomas Schwinge: OK to push "Fix 'char' initialization, copy, check in 'libgomp.oacc-fortran/acc-memcpy.f90'", see attached? OK. I think there was some remaining code around the problem that HUGE(1_int8) = 127 and '-128_int8' is invalid because in

Re: nvptx: 'cuDeviceGetCount' failure is fatal

2024-03-07 Thread Tobias Burnus
Hi Thomas, Thomas Schwinge wrote: /* Return the number of GCN devices on the system. */ int -GOMP_OFFLOAD_get_num_devices (void) +GOMP_OFFLOAD_get_num_devices (unsigned int omp_requires_mask) { if (!init_hsa_context ()) return 0; + /* Return -1 if no omp_requires_mask cannot be

Re: GCN: Even with 'GCN_SUPPRESS_HOST_FALLBACK' set, failure to 'init_hsa_runtime_functions' is not fatal

2024-03-07 Thread Tobias Burnus
Hi Thomas, first, I have the feeling we talk about (more or less) the same code region and use the same words – but we talk about rather different things. Thus, you confuse me (and possibly Andrew) – and my reply confuses you. Thomas Schwinge wrote: On 2024-03-07T12:43:07+0100, Tobias

Re: GCN: Even with 'GCN_SUPPRESS_HOST_FALLBACK' set, failure to 'init_hsa_runtime_functions' is not fatal

2024-03-07 Thread Tobias Burnus
Hi, Thomas Schwinge wrote: An issue with libgomp GCN plugin 'GCN_SUPPRESS_HOST_FALLBACK' (which is different from the libgomp-level host-fallback execution): +failure: + if (suppress_host_fallback) +GOMP_PLUGIN_fatal ("GCN host fallback has been suppressed"); + GCN_WARNING ("GCN target

[wwwdocs, committed] projects/gomp/: Fix typo, mark an item as implemented in GCC 14

2024-03-07 Thread Tobias Burnus
Found when glancing at it: A typo and an omission. Committed. Seehttps://gcc.gnu.org/projects/gomp/#omp5.2 for the result. Tobias commit f99d0f3a2c61ad6677170b9068d511c20ba1bfe1 Author: Tobias Burnus Date: Thu Mar 7 11:40:57 2024 +0100 projects/gomp/: Fix typo, mark an item

Re: [Patch] invoke.texi: Add note that -foffload= does not affect device detection

2024-03-04 Thread Tobias Burnus
Hi Sandra, Sandra Loosemore wrote: On 3/1/24 08:23, Tobias Burnus wrote: Maybe the proposed wording will help others to avoid this pitfall. (Or is this superfluous as -foffload= is not much used and, even if, no one then remembers or finds this none?) Well, I spent a long time looking

Re: [Patch] invoke.texi: Add note that -foffload= does not affect device detection

2024-03-04 Thread Tobias Burnus
Hi, Sandra Loosemore wrote: On 3/1/24 17:29, Sandra Loosemore wrote: On 3/1/24 08:23, Tobias Burnus wrote: Aside: Shouldn't all the HTML documents start with a and before the table of content? Currently, it has:    Top (GNU libgomp) and the body starts with    Short Table of Contents I

Re: [Patch] OpenMP/C++: Fix (first)private clause with member variables [PR110347]

2024-03-01 Thread Tobias Burnus
'shared' argument could be false was missed. The respective check has now been added. 2024-03-01 Jakub Jelinek Tobias Burnus PR c++/110347 gcc/ChangeLog: * gimplify.cc (omp_notice_variable): Fix 'shared' arg to lang_hooks.decls.omp_disregard_value_expr for (first)private in target

[Patch] invoke.texi: Add note that -foffload= does not affect device detection

2024-03-01 Thread Tobias Burnus
Not very often, but do I keep running into issues (fails, segfaults) related to testing programs compiled with a GCC without offload configured and then using the system libraries. - That's equivalent to having the system compiler (or any offload compiler) and compiling with -foffload=disable.

Re: [Patch] OpenACC: Update libgomp.texi + openacc{.f90,_lib.h} for 3.1 arg-name changes

2024-03-01 Thread Tobias Burnus
Hi Thomas, Thomas Schwinge wrote: On 2024-02-27T20:11:30+0100, Tobias Burnus wrote: The attached patch updates the manual to match OpenACC 3.3 specification for the implemented routines. But not update references to OpenACC 3.3, too? As the change is not really visible (except when using

Re: [committed] Set num_threads to 50 on 32-bit hppa in two libgomp loop tests

2024-03-01 Thread Tobias Burnus
Hi all, hi John & Thomas John David Anglin wrote: On 2024-02-29 6:02 p.m., Thomas Schwinge wrote: I wonder: shouldn't that cap at 50 threads happen inside libgomp, generally, instead of per test case and user code (!)? Per my understanding, OpenMP 'num_threads' specifies a *desired* number

Re: [PATCH] lto, Darwin: Fix offload section names.

2024-02-29 Thread Tobias Burnus
Hi Iain, hello world, Thomas Schwinge wrote: On 2024-01-16T15:00:16+, Iain Sandoe wrote: ... diff --git a/gcc/lto-section-names.h b/gcc/lto-section-names.h index a743deb4efb..1cdadf36ec0 100644 --- a/gcc/lto-section-names.h +++ b/gcc/lto-section-names.h ... @@ -35,8 +39,14 @@ extern

[wwwdocs] gcc-14/changes.html + projects/gomp/: OpenMP + OpenACC update

2024-02-27 Thread Tobias Burnus
Minor update for older and more recent changes. Comments? Tobias gcc-14/changes.html + projects/gomp/: OpenMP + OpenACC update Update OpenMP for two meanwhile implemented features (lvalue-expr in map, indirect now also in Fortran). Update OpenACC for one new feature (Fortran interface to

Re: [patch] OpenACC: Add Fortran routines acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*}

2024-02-27 Thread Tobias Burnus
Hi Thomas, (Regarding 'call acc_attach(x)' – the problem is that one needs the address of '' and 'x'; while 'x' is readily available, for '' no temporary variable has to get involved – and there are plenty of ways temporaries can get introduced; for most cases, an interface exists that

[Patch] Fortran/Openmp: Use OPT_Wopenmp for gfc_match_omp_depobj warning

2024-02-23 Thread Tobias Burnus
When checking something else, I noticed that there was one warning in openmp.cc that did not use OPT_Wopenmp. I intent to commit the attached patch later today as obvious. Tobias Fortran/Openmp: Use OPT_Wopenmp for gfc_match_omp_depobj warning gcc/fortran/ChangeLog: * openmp.cc

[Patch] OpenMP/nvptx: support 'arch(nvptx64)' as context selector

2024-02-20 Thread Tobias Burnus
I just encountered 'arch(nvptx64)'. I think it makes sense to support it as alias for 'nvptx' in the context selector for better compatibility. Comments, remarks, suggestions? Tobias PS: See the LLVM documentation below. I do note that those are not identical as LLVM uses 'nvptx' for 32bit

[patch] OpenACC: Add Fortran routines acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*}

2024-02-19 Thread Tobias Burnus
While waiting for some testing to finish, I got distracted and added the very low hanging OpenACC 3.3 fruits, i.e. those Fortran routines that directly map to their C counter part. Comments, remarks? Tobias OpenACC: Add Fortran routines

[Patch] libgomp: Device load_image - minor num-funcs/vars check improvement

2024-02-19 Thread Tobias Burnus
When debugging a linker issue, leading to a mismatch in the number of host/device functions, I was surprised by seeing one additional entry. Well, it turned out to be due to the ICV variable. This patch makes it more consistent. The "+1" is returned since r12-2769-g0bac793ed6bad2 (for the

[Patch] OpenMP/C++: Fix (first)private clause with member variables [PR110347] [was: [RFA/RFC] C++/OpenMP: Supporting (first)private for member variables [PR110347] - or VALUE_EXPR and gimplify]

2024-02-16 Thread Tobias Burnus
cating whether it is called for a target region or not. 2024-02-16 Tobias Burnus Jakub Jelinek PR c++/110347 gcc/cp/ChangeLog: * cp-gimplify.cc (cxx_omp_disregard_value_expr): Add new Boolean argument and use it. * cp-tree.h (cxx_omp_disregard_value_expr): Update prototy

[RFA/RFC] C++/OpenMP: Supporting (first)private for member variables [PR110347] - or VALUE_EXPR and gimplify

2024-02-16 Thread Tobias Burnus
The following works with PARALLEL but not with TARGET. OpenMP states the following is supposed to work: A = 5; // == this->A B = 6; // == this->B C[44] = 7; // == this->C; assume 'int C[100]' #pragma firstprivate(A,C) private(B) { A += 5; // Now: A is 10. B = 7;

[RFA/RFC] C++/OpenMP: Supporting (first)private for member variables [PR110347] - or VALUE_EXPR and gimplify

2024-02-16 Thread Tobias Burnus
The following works with PARALLEL but not with TARGET. OpenMP states the following is supposed to work: A = 5; // == this->A B = 6; // == this->B C[44] = 7; // == this->C; assume 'int C[100]' #pragma firstprivate(A,C) private(B) { A += 5; // Now: A is 10. B = 7; C[44]

Re: [Patch] OpenMP: Reject non-const 'condition' trait in Fortran

2024-02-13 Thread Tobias Burnus
Hi Jakub, Jakub Jelinek wrote: Of course it makes me wonder to what extent we actually do support the OpenMP 5.1 target_device device_num trait with constant or non-constant device num: Answer: If one removes some early errors such that the compiler continues a bit further, one gets: 36 |

[Patch] OpenMP: Reject non-const 'condition' trait in Fortran (was: [Patch] OpenMP: Handle DECL_ASSEMBLER_NAME with 'declare variant')

2024-02-13 Thread Tobias Burnus
Jakub Jelinek wrote: Isn't all this caused just by the missing check that condition trait has a constant expression? IMHO that is the way to handle it in GCC 14. Concur – how about the following patch? Tobias PS: See PR113904 for follow up tasks. / Instead of '.AND.' etc. I could have also

[Patch] OpenMP: Handle DECL_ASSEMBLER_NAME with 'declare variant'

2024-02-13 Thread Tobias Burnus
Inomp_resolve_declare_variant, a code path generates a new decl for the base function – in doing so, it ignores the assembler name. As the included Fortran example shows, this will lead to a linker error. Solution: Also copy over the assembler name. Comments, suggestions, remarks before I

Re: [PATCH v2] openmp, fortran: Add Fortran support for indirect clause on the declare target directive

2024-02-12 Thread Tobias Burnus
} +! { dg-xfail-run-if "Requires libgomp bug fix pending review" { offload_device } } Thanks, Tobias On 06/02/2024 9:03 am, Tobias Burnus wrote: LGTM. I just wonder whether there should be a value test and not just a does-not-crash-when-called test for the latter testcase, i.e. +++

Re: [PATCH v2] openmp, fortran: Add Fortran support for indirect clause on the declare target directive

2024-02-06 Thread Tobias Burnus
Kwok Cheung Yeung wrote: As previously discussed, this version of the patch adds code to emit a warning when a directive like this: !$omp declare target indirect(.true.) is encountered (i.e. a target directive containing at least one clause, but no to/enter clause, which appears to violate

Re: [v2][patch] plugin/plugin-nvptx.c: Fix fini_device call when already shutdown [PR113513]

2024-01-29 Thread Tobias Burnus
Hi Thomas, Thomas Schwinge wrote: On 2024-01-23T10:55:16+0100, Tobias Burnus wrote: plugin/plugin-nvptx.c: Fix fini_device call when already shutdown [PR113513] The following issue was found when running libgomp.c/target-52.c with nvptx offloading when the dg-set-target-env-var was honored

Re: [patch] gcn/gcn-valu.md: Disable fold_left_plus for TARGET_RDNA2_PLUS [PR113615]

2024-01-29 Thread Tobias Burnus
Andrew Stubbs wrote: /tmp/ccrsHfVQ.mkoffload.2.s:788736:27: error: value out of range    .amdhsa_next_free_vgpr    516 ^~~ [Obviously, likewise forlibgomp.c++/.. Hmm, supposedly there are 768 registers allocated in groups of 12, on gfx1100

[patch] gcn/gcn-valu.md: Disable fold_left_plus for TARGET_RDNA2_PLUS [PR113615]

2024-01-29 Thread Tobias Burnus
plus_): Only define for !TARGET_RDNA2_PLUS. Signed-off-by: Tobias Burnus gcc/config/gcn/gcn-valu.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md index cd027f8b369..23b441f8e8b 100644 --- a/gcc/config/gcn/gcn-valu.md +++

[committed] libgomp.c/declare-variant-4.h: Fix used variant function for gfx1030/gfx1100

2024-01-29 Thread Tobias Burnus
gcn-amdhsa-offload-tree-dump optimized "= gfx1100 \\(\\);" Committed as obvious as r14-8488-gcb366731e767e2 Tobias commit cb366731e767e2dec158c8c4a495fe2ccbd550ff Author: Tobias Burnus Date: Mon Jan 29 11:06:15 2024 +0100 libgomp.c/declare-variant-4.h: Fix used variant function

[wwwdocs][patch] gcc-14/changes.html (amdgcn): Update for gfx1030/gfx1100

2024-01-26 Thread Tobias Burnus
/changes.html (amdgcn): Update for gfx1030/gfx1100 Signed-off-by: Tobias Burnus diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index a04b62ff..2d777f52 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -329,6 +329,11 @@ a work-in-progress. AMD Radeon (GCN

[patch] install.texi: For gcn, recommend LLVM 15, unless gfx1100 is disabled (was: [patch] amdgcn: config.gcc - enable gfx1030 and gfx1100 multilib; add them to the docs)

2024-01-26 Thread Tobias Burnus
gcc/ChangeLog: * doc/install.texi (amdgcn): Recommend LLVM 15+ and newlib 4.4+, but keep requiring only newlib 4.3+ and, if gfx1100 is disabled, LLVM 13.0.1+. Signed-off-by: Tobias Burnus diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 5747b5a12fe..c7794439107 100644 --- a/gcc/

Re: [patch] amdgcn: config.gcc - enable gfx1030 and gfx1100 multilib; add them to the docs

2024-01-26 Thread Tobias Burnus
Hi Richard, Richard Biener wrote: Looks good to me. Thanks - I will commit it after lunch to see whether someone else has additional comments. +@item gfx1030 +Compile for RDNA2 gfx1030 devices (GFX10 series). + +@item gfx1100 +Compile for RDNA3 gfx1100 devices (GFX11 series). Btw, "GFX10"

Re: [patch] amdgcn: config.gcc - enable gfx1030 and gfx1100 multilib; add them to the docs

2024-01-26 Thread Tobias Burnus
Now with patch ... Tobias Burnus wrote: Hi all, hi Richard & Andrew, Am 24.01.24 um 17:01 schrieb Tobias Burnus: This patch obviously depends on Andrew's; he wrote in the previous email of this thread regarding his patch: Andrew Stubbs wrote: This is enough to get gfx1100 working for

Re: [PATCH] Avoid registering unsupported OMP offload devices

2024-01-26 Thread Tobias Burnus
Jakub Jelinek wrote: On Fri, Jan 26, 2024 at 01:00:28PM +0100, Richard Biener wrote: libgomp/ * plugin/plugin-gcn.c (suitable_hsa_agent_p): Filter out agents with unsupported ISA. ... @@ -1443,6 +1445,13 @@ suitable_hsa_agent_p (hsa_agent_t agent) switch (device_type)

  1   2   3   4   5   6   7   8   9   10   >