public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: 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: Sat, 1 Apr 2023 10:42:18 +0200	[thread overview]
Message-ID: <87ilegouxh.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <20230324153046.3996092-2-frederik@codesourcery.com>

Hi Frederik!

Thanks for including a good number of test cases with your code changes!

This new test case:

On 2023-03-24T16:30:39+0100, Frederik Harwath <frederik@codesourcery.com> wrote:
> --- /dev/null
> +++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-1.f90
> @@ -0,0 +1,52 @@
> +! { dg-additional-options "-fdump-tree-original" }
> +! { dg-do run }
> +
> +module test_functions
> +  contains
> +  integer function compute_sum() result(sum)
> +    implicit none
> +
> +    integer :: i,j
> +
> +    !$omp do
> +    do i = 1,10,3
> +       !$omp unroll full
> +       do j = 1,10,3
> +          sum = sum + 1
> +       end do
> +    end do
> +  end function
> +
> +  integer function compute_sum2() result(sum)
> +    implicit none
> +
> +    integer :: i,j
> +
> +    !$omp parallel do reduction(+:sum)
> +    !$omp unroll partial(2)
> +    do i = 1,10,3
> +       do j = 1,10,3
> +          sum = sum + 1
> +       end do
> +    end do
> +  end function
> +end module test_functions
> +
> +program test
> +  use test_functions
> +  implicit none
> +
> +  integer :: result
> +
> +  result = compute_sum ()
> +  write (*,*) result
> +  if (result .ne. 16) then
> +     call abort
> +  end if
> +
> +  result = compute_sum2 ()
> +  write (*,*) result
> +  if (result .ne. 16) then
> +     call abort
> +  end if
> +end program

... I see FAIL for x86_64-pc-linux-gnu '-m32' (thus, host, not
offloading), '-O0' (only):

    spawn [open ...]
      1437822992

    Program aborted. Backtrace:
    #0  0x8048df0 in ???
    #1  0x8048ea6 in ???
    #2  0x559a3af2 in ???
    #3  0x8048bc0 in ???
    FAIL: libgomp.fortran/loop-transforms/unroll-1.f90   -O0  execution test

All other variants PASS with:

    spawn [open ...]
              16
              16

And similarly, this new test case:

> --- /dev/null
> +++ b/libgomp/testsuite/libgomp.fortran/loop-transforms/unroll-simd-1.f90
> @@ -0,0 +1,33 @@
> +! { dg-options "-fno-openmp -fopenmp-simd" }
> +! { dg-additional-options "-fdump-tree-original" }
> +! { dg-do run }
> +
> +module test_functions
> +  contains
> +  integer function compute_sum() result(sum)
> +    implicit none
> +
> +    integer :: i,j
> +
> +    !$omp simd
> +    do i = 1,10,3
> +       !$omp unroll full
> +       do j = 1,10,3
> +          sum = sum + 1
> +       end do
> +    end do
> +  end function compute_sum
> +end module test_functions
> +
> +program test
> +  use test_functions
> +  implicit none
> +
> +  integer :: result
> +
> +  result = compute_sum ()
> +  write (*,*) result
> +  if (result .ne. 16) then
> +     call abort
> +  end if
> +end program

... I see FAIL for x86_64-pc-linux-gnu '-m32' (thus, host, not
offloading), '-O0' (only):

    spawn [open ...]
              41

    Program aborted. Backtrace:
    #0  0x8048c35 in ???
    #1  0x8048c72 in ???
    #2  0x55977af2 in ???
    #3  0x8048a60 in ???
    FAIL: libgomp.fortran/loop-transforms/unroll-simd-1.f90   -O0  execution test

All other variants PASS with:

    spawn [open ...]
              16


Grüße
 Thomas


-----------------
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	other threads:[~2023-04-01  8:42 UTC|newest]

Thread overview: 21+ 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 [this message]
2023-04-06 13:07     ` Frederik Harwath
2023-03-24 15:30 ` [PATCH 2/7] openmp: Add C/C++ " Frederik Harwath
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 5/7] openmp: Add C/C++ " Frederik Harwath
2023-03-24 15:30 ` [PATCH 6/7] openmp: Add Fortran support for loop transformations on inner loops Frederik Harwath
2023-03-24 15:30 ` [PATCH 7/7] openmp: Add C/C++ " 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
2023-07-28 13:04 ` [PATCH 0/4] openmp: loop transformation fixes Frederik Harwath
2023-07-28 13:04   ` [PATCH 1/4] openmp: Fix loop transformation tests Frederik Harwath
2023-07-28 13:04   ` [PATCH 2/4] openmp: Fix initialization for 'unroll full' Frederik Harwath
2023-07-28 13:04   ` [PATCH 3/4] openmp: Fix diagnostic message for "omp unroll" Frederik Harwath
2023-07-28 13:04   ` [PATCH 4/4] openmp: Fix number of iterations computation for "omp unroll full" Frederik Harwath

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=87ilegouxh.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=fortran@gcc.gnu.org \
    --cc=frederik@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).