Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flang] Assignments for variables of a derived type are slower than GFortran #121132

Open
yus3710-fj opened this issue Dec 26, 2024 · 0 comments
Open
Labels
flang Flang issues not falling into any other category performance

Comments

@yus3710-fj
Copy link
Contributor

yus3710-fj commented Dec 26, 2024

The execution of the following codes is slower than GFortran.

  • test.f90
module d
  type mytype1
    integer :: x,y,z
  end type
end module

subroutine ddsnnn004(lhs,rhs)
  use d
  type(mytype1) :: rhs
  type(mytype1) :: lhs
  lhs = rhs
end subroutine
  • main.f90
use d
implicit none

integer, parameter :: count = 40000
integer :: i,j,k
type(mytype1) :: t1,t2
real :: start_t, end_t
interface
  subroutine ddsnnn004(lhs,rhs)
    use d
    type(mytype1) :: rhs
    type(mytype1) :: lhs
  end subroutine
end interface

call cpu_time(start_t)
do i=1,count
  do j=1,count
    call ddsnnn004(t1,t2)
  end do
end do
call cpu_time(end_t)

print *, end_t - start_t
end
  • commands
$ flang -Ofast -mcpu=native test.f90 main.f90 && ./a.out # for A64FX/Grace
$ flang -Ofast -march=native test.f90 main.f90 && ./a.out # for Xeon
Flang [s] GFortran [s]
A64FX 15.933074 3.21280599
Grace 2.9103858 0.975975990
Xeon 3.3161151 1.50089002
@github-actions github-actions bot added the flang Flang issues not falling into any other category label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category performance
Projects
None yet
Development

No branches or pull requests

1 participant