Skip to content

Commit

Permalink
[openmp][flang][offloading] Do not use fixed device IDs in checks (#7…
Browse files Browse the repository at this point in the history
…8973)

Fixes a small issues in an offloading test where the test dependec on
the host and device being assigned certains numeric IDs. This however is
not stable and fails in situations where any of the devices is assigned
an ID different from the expected value. The fix just checks that
offloading succeeded by making sure the IDs are different.

The test was failing locally for me.
  • Loading branch information
ergawy committed Jan 24, 2024
1 parent fb9a82b commit 383d488
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ program main
devices(2) = omp_get_device_num()
!$omp end target
print *, "var1 after target = ", var1
print *, "devices: ", devices
print *, "devices are different? ", (devices(1) /= devices(2))
end program

! CHECK: var1 before target = 10
! CHECK: var1 after target = 20
! CHECK: devices: 1 0
! CHECK: devices are different? T

0 comments on commit 383d488

Please sign in to comment.