From d2903ce05bf055daeafe14e8b0b2be133ce180be Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Wed, 13 Nov 2019 12:37:59 +0000 Subject: Add device number to GOMP_OFFLOAD_openacc_async_construct 2019-11-13 Andrew Stubbs Julian Brown libgomp/ * libgomp-plugin.h (GOMP_OFFLOAD_openacc_async_construct): Add int parameter. * oacc-async.c (lookup_goacc_asyncqueue): Pass device number to the queue constructor. * oacc-host.c (host_openacc_async_construct): Add device parameter. * plugin/plugin-nvptx.c (GOMP_OFFLOAD_openacc_async_construct): Add device parameter. Co-Authored-By: Julian Brown From-SVN: r278134 --- libgomp/ChangeLog | 11 +++++++++++ libgomp/libgomp-plugin.h | 2 +- libgomp/oacc-async.c | 3 ++- libgomp/oacc-host.c | 2 +- libgomp/plugin/plugin-nvptx.c | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) (limited to 'libgomp') diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index ad9fdea..c897798 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,4 +1,15 @@ 2019-11-13 Andrew Stubbs + Julian Brown + + * libgomp-plugin.h (GOMP_OFFLOAD_openacc_async_construct): Add int + parameter. + * oacc-async.c (lookup_goacc_asyncqueue): Pass device number to the + queue constructor. + * oacc-host.c (host_openacc_async_construct): Add device parameter. + * plugin/plugin-nvptx.c (GOMP_OFFLOAD_openacc_async_construct): Add + device parameter. + +2019-11-13 Andrew Stubbs * configure.tgt (nvptx*-*-*): Add "accel" directory. * config/nvptx/libgomp-plugin.c: Move ... diff --git a/libgomp/libgomp-plugin.h b/libgomp/libgomp-plugin.h index 01483f2..de969e1 100644 --- a/libgomp/libgomp-plugin.h +++ b/libgomp/libgomp-plugin.h @@ -112,7 +112,7 @@ extern void GOMP_OFFLOAD_openacc_exec (void (*) (void *), size_t, void **, void **, unsigned *, void *); extern void *GOMP_OFFLOAD_openacc_create_thread_data (int); extern void GOMP_OFFLOAD_openacc_destroy_thread_data (void *); -extern struct goacc_asyncqueue *GOMP_OFFLOAD_openacc_async_construct (void); +extern struct goacc_asyncqueue *GOMP_OFFLOAD_openacc_async_construct (int); extern bool GOMP_OFFLOAD_openacc_async_destruct (struct goacc_asyncqueue *); extern int GOMP_OFFLOAD_openacc_async_test (struct goacc_asyncqueue *); extern bool GOMP_OFFLOAD_openacc_async_synchronize (struct goacc_asyncqueue *); diff --git a/libgomp/oacc-async.c b/libgomp/oacc-async.c index 1760e8c..2b24ae7 100644 --- a/libgomp/oacc-async.c +++ b/libgomp/oacc-async.c @@ -100,7 +100,8 @@ lookup_goacc_asyncqueue (struct goacc_thread *thr, bool create, int async) if (!dev->openacc.async.asyncqueue[async]) { - dev->openacc.async.asyncqueue[async] = dev->openacc.async.construct_func (); + dev->openacc.async.asyncqueue[async] + = dev->openacc.async.construct_func (dev->target_id); if (!dev->openacc.async.asyncqueue[async]) { diff --git a/libgomp/oacc-host.c b/libgomp/oacc-host.c index 12299ae..cbcac9b 100644 --- a/libgomp/oacc-host.c +++ b/libgomp/oacc-host.c @@ -211,7 +211,7 @@ host_openacc_async_queue_callback (struct goacc_asyncqueue *aq } static struct goacc_asyncqueue * -host_openacc_async_construct (void) +host_openacc_async_construct (int device __attribute__((unused))) { /* Non-NULL 0xffff... value as opaque dummy. */ return (struct goacc_asyncqueue *) -1; diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c index 9e08861..911d0f6 100644 --- a/libgomp/plugin/plugin-nvptx.c +++ b/libgomp/plugin/plugin-nvptx.c @@ -1575,7 +1575,7 @@ GOMP_OFFLOAD_openacc_cuda_set_stream (struct goacc_asyncqueue *aq, void *stream) } struct goacc_asyncqueue * -GOMP_OFFLOAD_openacc_async_construct (void) +GOMP_OFFLOAD_openacc_async_construct (int device __attribute__((unused))) { CUstream stream = NULL; CUDA_CALL_ERET (NULL, cuStreamCreate, &stream, CU_STREAM_DEFAULT); -- cgit v1.1