[openacc] Factor out async argument utility functions
2018-05-09 Tom de Vries <tom@codesourcery.com>
PR libgomp/83792
* oacc-int.h (async_valid_stream_id_p, async_valid_p)
(async_synchronous_p): New function.
* oacc-async.c (acc_async_test, acc_wait, acc_wait_all_async): Use
async_valid_p.
* oacc-cuda.c (acc_get_cuda_stream, acc_set_cuda_stream): Use
async_valid_stream_id_p.
* oacc-mem.c (gomp_acc_remove_pointer): Use async_synchronous_p.
* oacc-parallel.c (GOACC_parallel_keyed): Same.
From-SVN: r260081
diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c
index a71b399..cfba581 100644
--- a/libgomp/oacc-parallel.c
+++ b/libgomp/oacc-parallel.c
@@ -183,7 +183,7 @@
async, dims, tgt);
/* If running synchronously, unmap immediately. */
- if (async < acc_async_noval)
+ if (async_synchronous_p (async))
gomp_unmap_vars (tgt, true);
else
tgt->device_descr->openacc.register_async_cleanup_func (tgt, async);