3 implicit none (type, external)
5 character(:), pointer :: str
7 character(:), pointer :: str
9 type(t
), allocatable
:: strs(:)
11 allocate(strs(0:omp_get_num_devices ()))
13 do i
= omp_invalid_device
- 1, omp_get_num_devices () + 1
14 str
=> omp_get_uid_from_device (i
)
15 dev
= omp_get_device_from_uid (str
)
16 ! print *, i, str, dev
17 if (i
< omp_initial_device
.or
. i
> omp_get_num_devices ()) then
18 if (dev
/= omp_invalid_device
.or
. associated(str
)) &
22 if (.not
. associated(str
)) &
24 if (i
== omp_initial_device
.or
. i
== omp_get_num_devices ()) then
25 if ((dev
/= omp_initial_device
.and
. dev
/= omp_get_num_devices ()) &
26 .or
. str
/= "OMP_INITIAL_DEVICE") & ! /* GCC impl. choice */
28 dev
= omp_get_num_devices ()
29 else if (dev
/= i
.or
. len(str
) == 0) then
35 ! Check substring handling
36 character(len
=100) :: long_str
38 long_str
= str
// "ABCDEF"
39 dev2
= omp_get_device_from_uid (long_str(1:len(str
)))
40 if (i
== omp_initial_device
.or
. i
== omp_get_num_devices ()) then
41 if (dev2
/= omp_initial_device
.and
. dev2
/= omp_get_num_devices ()) &
43 else if (dev
/= dev2
) then
49 do i
= 0, omp_get_num_devices () - 1
50 do j
= i
+ 1, omp_get_num_devices ()
51 if (strs(i
)%str
== strs(j
)%str
) &