1 /* Several of the async/wait combinations invoked here are no-ops -- they don't
2 effect anything, but are still valid.
4 This doesn't verify that the asynchronous operations synchronize correctly,
5 but just verifies that we don't refuse any variants. */
11 int values
[] = { acc_async_sync
,
18 const size_t values_n
= sizeof values
/ sizeof values
[0];
23 /* Explicitly initialize: it's not clear whether the following OpenACC
24 runtime library calls implicitly initialize;
25 <https://github.com/OpenACC/openacc-spec/issues/102>. */
27 #if defined ACC_DEVICE_TYPE_nvidia
28 d
= acc_device_nvidia
;
29 #elif defined ACC_DEVICE_TYPE_radeon
30 d
= acc_device_radeon
;
31 #elif defined ACC_DEVICE_TYPE_host
34 # error Not ported to this ACC_DEVICE_TYPE
39 for (size_t i
= 0; i
< values_n
; ++i
)
40 assert (acc_async_test (values
[i
]) == 1);
43 for (size_t i
= 0; i
< values_n
; ++i
)
45 #pragma acc parallel wait (values[i])
47 #pragma acc wait (values[i])
52 for (size_t i
= 0; i
< values_n
; ++i
)
54 for (size_t j
= 0; j
< values_n
; ++j
)
56 #pragma acc parallel wait (values[i]) async (values[j])
58 #pragma acc wait (values[i]) async (values[j])
59 acc_wait_async (values
[i
], values
[j
]);
64 for (size_t i
= 0; i
< values_n
; ++i
)
66 #pragma acc parallel wait async (values[i])
68 #pragma acc wait async (values[i])
69 acc_wait_all_async (values
[i
]);