Commit 29763443 authored by Budiardja, Reuben's avatar Budiardja, Reuben
Browse files

Fixed reproducer.

parent 1758d19d
!-- This is a reproducer of an issue observed in an ECP application.
! The issue seems to stem from a declared target array variables
! being used as arguments to nested declared-target
! subroutines. The error happens at the linking stage.
!-- There could be two possible distinct issues here with CCE.
! The first one is as written in the code.
! The second one shows up when '!$OMP private' in gpuomp_routine()
! is commented out. It triggers a different linking error.
module comm module comm
implicit none implicit none
real, dimension ( : ), allocatable :: & real, dimension ( : ), allocatable :: &
cmaxa, cmaxb cmaxa, cmaxb
!$OMP declare target ( cmaxa, cmaxb ) !$OMP declare target ( cmaxa, cmaxb )
integer :: &
ncmax
end module comm end module comm
module ext_module
implicit none
contains
subroutine ext_routine ( d1, cmaxa, cmaxb, size )
implicit none
real, intent ( inout ) :: &
d1
integer, intent ( in ) :: &
size
real, dimension ( : ) :: &
cmaxa ( size ), cmaxb ( size )
!$OMP declare target
end subroutine ext_routine
end module ext_module
module gpuomp module gpuomp
implicit none implicit none
contains contains
subroutine gpuomp_routine ( d1, d2, d3 ) subroutine gpuomp_routine ( d1 )
use comm, only: cmaxa, cmaxb use comm, only: cmaxa, cmaxb, ncmax
real, intent ( inout ) :: & real, intent ( inout ) :: &
d1, d2, d3 d1
integer :: & integer :: &
iV iV
!$OMP target teams distribute parallel do & !$OMP target teams distribute parallel do &
!$OMP private ( cmaxa, cmaxb ) !$OMP private ( cmaxa, cmaxb )
do iV = 1, 3200 do iV = 1, 3200
call gpuomp_routine2 ( d1, d2, d3, cmaxa, cmaxb, 3200 ) call gpuomp_routine2 ( d1, cmaxa, cmaxb, ncmax )
end do end do
!$OMP end target teams distribute parallel do !$OMP end target teams distribute parallel do
end subroutine gpuomp_routine end subroutine gpuomp_routine
subroutine gpuomp_routine2 ( d1, cmaxa, cmaxb, size )
subroutine gpuomp_routine2 ( d1, d2, d3, cmaxa, cmaxb, nsize ) use ext_module
real, intent ( inout ) :: & real, intent ( inout ) :: &
d1, d2, d3 d1
integer, intent ( in ) :: & integer, intent ( in ) :: &
nsize size
real, dimension ( : ) :: & real, dimension ( : ) :: &
cmaxa ( nsize ), cmaxb ( nsize ) cmaxa, cmaxb
!$OMP declare target !$OMP declare target
call ext_routine ( d1, d2, d3, cmaxa, cmaxb, nsize ) call ext_routine ( d1, cmaxa, cmaxb, size )
end subroutine gpuomp_routine2 end subroutine gpuomp_routine2
end module gpuomp end module gpuomp
module ext_module
implicit none
contains
subroutine ext_routine ( d1, d2, d3, cmaxa, cmaxb, nsize )
real, intent ( inout ) :: &
d1, d2, d3
integer, intent ( in ) :: &
nsize
real, dimension ( : ) :: &
cmaxa ( nsize ), cmaxb ( nsize )
!$OMP declare target
end subroutine ext_routine
end module ext_module
program test program test
!-- dummy program !-- Dummy 'main' program so that we can link.
end program test end program test
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment