public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Frederik Harwath <frederik.harwath@siemens.com>
To: Thomas Schwinge <thomas@codesourcery.com>,
	Frederik Harwath <frederik@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, tobias@codesourcery.com,
	fortran@gcc.gnu.org, jakub@redhat.com
Subject: Re: [PATCH 1/7] openmp: Add Fortran support for "omp unroll" directive
Date: Thu, 6 Apr 2023 15:07:05 +0200	[thread overview]
Message-ID: <326cdf1e-24ed-bcf3-be26-72f72524b915@siemens.com> (raw)
In-Reply-To: <87ilegouxh.fsf@euler.schwinge.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

Hi Thomas,

On 01.04.23 10:42, Thomas Schwinge wrote:
> ... I see FAIL for x86_64-pc-linux-gnu '-m32' (thus, host, not
> offloading), '-O0' (only):
>    
[...]
>      FAIL: libgomp.fortran/loop-transforms/unroll-1.f90   -O0  execution test
[...]
>      FAIL: libgomp.fortran/loop-transforms/unroll-simd-1.f90   -O0  execution test


Thank you for reporting the failures! They are caused by mistakes in the 
test code, not the implementation. I have attached a patch which fixes 
the failures.

I have been able to reproduce the failures with -m32. With the patch 
they went away, even with 100 of repeated test executions ;-).


Best regards,

Frederik

[-- Attachment #2: 0001-openmp-Fix-loop-transformation-tests.patch --]
[-- Type: text/x-patch, Size: 2453 bytes --]

From 3f471ed293d2e97198a65447d2f0d2bb69a2f305 Mon Sep 17 00:00:00 2001
From: Frederik Harwath <frederik@codesourcery.com>
Date: Thu, 6 Apr 2023 14:52:07 +0200
Subject: [PATCH] openmp: Fix loop transformation tests

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/loop-transforms/tile-2.f90: Add reduction clause.
	* testsuite/libgomp.fortran/loop-transforms/unroll-1.f90: Initialize var.
	* testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90: Add reduction
	and initialization.
---
 libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90   | 2 +-
 libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90 | 2 ++
 .../libgomp.fortran/loop-transforms/unroll-simd-1.f90          | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90 b/libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90
index 6aedbf4724f..a7cb5e7635d 100644
--- a/libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90
+++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/tile-2.f90
@@ -69,7 +69,7 @@ module test_functions
     integer :: i,j
 
     sum = 0
-    !$omp parallel do collapse(2)
+    !$omp parallel do collapse(2) reduction(+:sum)
     !$omp tile sizes(6,10)
     do i = 1,10,3
        do j = 1,10,3
diff --git a/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90 b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90
index f07aab898fa..b91ea275577 100644
--- a/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90
@@ -8,6 +8,7 @@ module test_functions
 
     integer :: i,j
 
+    sum = 0
     !$omp do
     do i = 1,10,3
        !$omp unroll full
@@ -22,6 +23,7 @@ module test_functions
 
     integer :: i,j
 
+    sum = 0
     !$omp parallel do reduction(+:sum)
     !$omp unroll partial(2)
     do i = 1,10,3
diff --git a/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90 b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90
index 5fb64ddd6fd..7a43458f0dd 100644
--- a/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90
+++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90
@@ -9,7 +9,8 @@ module test_functions
 
     integer :: i,j
 
-    !$omp simd
+    sum = 0
+    !$omp simd reduction(+:sum)
     do i = 1,10,3
        !$omp unroll full
        do j = 1,10,3
-- 
2.36.1


  reply	other threads:[~2023-04-06 13:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24 15:30 [PATCH 0/7] openmp: OpenMP 5.1 loop transformation directives Frederik Harwath
2023-03-24 15:30 ` [PATCH 1/7] openmp: Add Fortran support for "omp unroll" directive Frederik Harwath
2023-04-01  8:42   ` Thomas Schwinge
2023-04-06 13:07     ` Frederik Harwath [this message]
2023-03-24 15:30 ` [PATCH 3/7] openacc: Rename OMP_CLAUSE_TILE to OMP_CLAUSE_OACC_TILE Frederik Harwath
2023-03-24 15:30 ` [PATCH 4/7] openmp: Add Fortran support for "omp tile" Frederik Harwath
2023-03-24 15:30 ` [PATCH 6/7] openmp: Add Fortran support for loop transformations on inner loops Frederik Harwath
2023-05-15 10:19 ` [PATCH 0/7] openmp: OpenMP 5.1 loop transformation directives Jakub Jelinek
2023-05-15 11:03   ` Jakub Jelinek
2023-05-16  9:45   ` Frederik Harwath
2023-05-16 11:00     ` Jakub Jelinek
2023-05-17 11:55       ` Frederik Harwath
2023-05-22 14:20         ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=326cdf1e-24ed-bcf3-be26-72f72524b915@siemens.com \
    --to=frederik.harwath@siemens.com \
    --cc=fortran@gcc.gnu.org \
    --cc=frederik@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=thomas@codesourcery.com \
    --cc=tobias@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).