5 include "openacc_lib.h"
9 if (acc_get_num_devices (acc_device_nvidia
) .ne
. 0) then
11 call acc_init (acc_device_nvidia
)
15 call acc_set_device_num (n
, acc_device_nvidia
)
17 if (acc_get_device_num (acc_device_nvidia
) .ne
. 0) STOP 1
19 if (acc_get_num_devices (acc_device_nvidia
) .gt
. 1) then
23 call acc_set_device_num (n
, acc_device_nvidia
)
25 if (acc_get_device_num (acc_device_nvidia
) .ne
. 1) STOP 2
29 call acc_shutdown (acc_device_nvidia
)
33 if (acc_get_num_devices (acc_device_radeon
) .ne
. 0) then
35 call acc_init (acc_device_radeon
)
39 call acc_set_device_num (n
, acc_device_radeon
)
41 if (acc_get_device_num (acc_device_radeon
) .ne
. 0) STOP 1
43 if (acc_get_num_devices (acc_device_radeon
) .gt
. 1) then
47 call acc_set_device_num (n
, acc_device_radeon
)
49 if (acc_get_device_num (acc_device_radeon
) .ne
. 1) STOP 2
53 call acc_shutdown (acc_device_radeon
)