From 18c247cc0b7b15a0910641e7de29b35f2025a4f8 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 14 Dec 2018 21:42:08 +0100 Subject: [PR88370] acc_get_cuda_stream/acc_set_cuda_stream: acc_async_sync, acc_async_noval Per my reading of the OpenACC specification (and as supported by secondary documentation, such as code examples, or presentations), it's valid to call "acc_get_cuda_stream"/"acc_set_cuda_stream" also with "acc_async_sync", "acc_async_noval" arguments, not just with the nonnegative values as currently implemented. libgomp/ PR libgomp/88370 * libgomp.texi (acc_get_current_cuda_context, acc_get_cuda_stream) (acc_set_cuda_stream): Clarify. * oacc-cuda.c (acc_get_cuda_stream, acc_set_cuda_stream): Use "async_valid_p". * plugin/plugin-nvptx.c (nvptx_set_cuda_stream): Refuse "async == acc_async_sync". * testsuite/libgomp.oacc-c-c++-common/acc_set_cuda_stream-1.c: New file. * testsuite/libgomp.oacc-c-c++-common/async_queue-1.c: Likewise. * testsuite/libgomp.oacc-c-c++-common/lib-84.c: Update. * testsuite/libgomp.oacc-c-c++-common/lib-85.c: Likewise. From-SVN: r267147 --- 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 20774c1..4ee4c9b 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_valid_stream_id_p (async)) + if (!async_valid_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_valid_stream_id_p (async) || stream == NULL) + if (!async_valid_p (async) || stream == NULL) return 0; goacc_lazy_initialize (); -- cgit v1.1