Skip to content

Commit 383d488

Browse files
authored
[openmp][flang][offloading] Do not use fixed device IDs in checks (#78973)
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.
1 parent fb9a82b commit 383d488

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openmp/libomptarget/test/offloading/fortran/target_map_common_block1.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ program main
2020
devices(2) = omp_get_device_num()
2121
!$omp end target
2222
print *, "var1 after target = ", var1
23-
print *, "devices: ", devices
23+
print *, "devices are different? ", (devices(1) /= devices(2))
2424
end program
2525

2626
! CHECK: var1 before target = 10
2727
! CHECK: var1 after target = 20
28-
! CHECK: devices: 1 0
28+
! CHECK: devices are different? T

0 commit comments

Comments
 (0)