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

Updated to logical condition to remove workaround.

parent 7903c1b9
......@@ -29,9 +29,9 @@ program OpenMP_metadirective_user_condition_target_test
print*, ''
allocate ( A ( 32**3 * 10 ) )
allocate ( B ( 32**3 * 10 ) )
allocate ( C ( 32**3 * 10 ) )
allocate ( A ( 128**3 * 10 ) )
allocate ( B ( 128**3 * 10 ) )
allocate ( C ( 128**3 * 10 ) )
allocate ( C_Ref, source = C )
call random_number ( A )
......@@ -78,7 +78,7 @@ contains
UseDevice = UseDeviceOption
!$OMP begin metadirective &
!$OMP when ( user = { condition ( UseDevice .EQV. .true. ) } &
!$OMP when ( user = { condition ( UseDevice ) } &
!$OMP : target map ( tofrom : OD ) )
OD = .not. omp_is_initial_device()
!$OMP end metadirective
......@@ -120,19 +120,19 @@ contains
if ( UseDevice ) then
!$OMP metadirective &
!$OMP when ( user = { condition ( UseDevice .EQV. .true. ) } &
!$OMP when ( user = { condition ( UseDevice ) } &
!$OMP : target teams distribute parallel do )
do iV = 1, size ( A )
C ( iV ) = A ( iV ) + B ( iV )
C ( iV ) = A ( iV ) * B ( iV )**2 + B ( iV )
end do
else
!$OMP metadirective &
!$OMP when ( user = { condition ( UseDevice .EQV. .false. ) } &
!$OMP when ( user = { condition ( .not. UseDevice ) } &
!$OMP : parallel do )
do iV = 1, size ( A )
C ( iV ) = A ( iV ) + B ( iV )
C ( iV ) = A ( iV ) * B ( iV )**2 + B ( iV )
end do
end if
......
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