From edbd038a5f0f903cacb549f09b1d992c4222ca10 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 9 May 2018 13:52:49 +0000 Subject: [openacc] Factor out async argument utility functions 2018-05-09 Tom de Vries 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 --- libgomp/oacc-cuda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgomp/oacc-cuda.c') diff --git a/libgomp/oacc-cuda.c b/libgomp/oacc-cuda.c index c388170bffb..20774c1b487 100644 --- a/libgomp/oacc-cuda.c +++ b/libgomp/oacc-cuda.c @@ -58,7 +58,7 @@ acc_get_cuda_stream (int async) { struct goacc_thread *thr = goacc_thread (); - if (async < 0) + if (!async_valid_stream_id_p (async)) return NULL; if (thr && thr->dev && thr->dev->openacc.cuda.get_stream_func) @@ -72,7 +72,7 @@ acc_set_cuda_stream (int async, void *stream) { struct goacc_thread *thr; - if (async < 0 || stream == NULL) + if (!async_valid_stream_id_p (async) || stream == NULL) return 0; goacc_lazy_initialize (); -- cgit v1.2.3