summaryrefslogtreecommitdiff
path: root/libgomp/oacc-cuda.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2018-05-09 13:52:49 +0000
committerTom de Vries <vries@gcc.gnu.org>2018-05-09 13:52:49 +0000
commitedbd038a5f0f903cacb549f09b1d992c4222ca10 (patch)
tree09f3372550d0a9f29fae94eb1220e3609cca1b1e /libgomp/oacc-cuda.c
parent88b1e41c2d9d2e9f5c0ae2d1a09da41d76184280 (diff)
[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
Diffstat (limited to 'libgomp/oacc-cuda.c')
-rw-r--r--libgomp/oacc-cuda.c4
1 files changed, 2 insertions, 2 deletions
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 ();