public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, libgomp, openacc] Use GOMP_ASYNC_SYNC in GOACC_declare
@ 2017-11-17  9:13 Tom de Vries
  2018-05-09 16:08 ` Tom de Vries
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2017-11-17  9:13 UTC (permalink / raw)
  To: Jakub Jelinek, Thomas Schwinge; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 778 bytes --]

Hi,

GOACC_enter_exit_data has this prototype:
...
void
GOACC_enter_exit_data (int device, size_t mapnum,
                        void **hostaddrs, size_t *sizes,
                        unsigned short *kinds,
                        int async, int num_waits, ...)
...

And GOACC_declare calls GOACC_enter_exit_data with async arg zero:
...
           case GOMP_MAP_DELETE:
             GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
                                    &kinds[i], 0, 0);
...

Async arg zero means some async queue (see openacc 2.0a, 2.14.1 "async 
clause" for more details).

The declare directive has no async clause, so the arg should be 
GOMP_ASYNC_SYNC.

Tested libgomp testsuite on x86_64 with nvptx accelerator.

OK for trunk?

Thanks,
- Tom

[-- Attachment #2: 0001-Use-GOMP_ASYNC_SYNC-in-GOACC_declare.patch --]
[-- Type: text/x-patch, Size: 1367 bytes --]

Use GOMP_ASYNC_SYNC in GOACC_declare

Fix for PR82901 - "GOACC_declare calls GOACC_enter_exit_data with async arg 0"

---
 libgomp/oacc-parallel.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c
index a8cff9e..d82d500 100644
--- a/libgomp/oacc-parallel.c
+++ b/libgomp/oacc-parallel.c
@@ -524,7 +524,7 @@ GOACC_declare (int device, size_t mapnum,
 	  case GOMP_MAP_POINTER:
 	  case GOMP_MAP_DELETE:
 	    GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
-				   &kinds[i], 0, 0);
+				   &kinds[i], GOMP_ASYNC_SYNC, 0);
 	    break;
 
 	  case GOMP_MAP_FORCE_DEVICEPTR:
@@ -533,19 +533,19 @@ GOACC_declare (int device, size_t mapnum,
 	  case GOMP_MAP_ALLOC:
 	    if (!acc_is_present (hostaddrs[i], sizes[i]))
 	      GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
-				     &kinds[i], 0, 0);
+				     &kinds[i], GOMP_ASYNC_SYNC, 0);
 	    break;
 
 	  case GOMP_MAP_TO:
 	    GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
-				   &kinds[i], 0, 0);
+				   &kinds[i], GOMP_ASYNC_SYNC, 0);
 
 	    break;
 
 	  case GOMP_MAP_FROM:
 	    kinds[i] = GOMP_MAP_FORCE_FROM;
 	    GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
-				   &kinds[i], 0, 0);
+				   &kinds[i], GOMP_ASYNC_SYNC, 0);
 	    break;
 
 	  case GOMP_MAP_FORCE_PRESENT:

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, libgomp, openacc] Use GOMP_ASYNC_SYNC in GOACC_declare
  2017-11-17  9:13 [PATCH, libgomp, openacc] Use GOMP_ASYNC_SYNC in GOACC_declare Tom de Vries
@ 2018-05-09 16:08 ` Tom de Vries
  0 siblings, 0 replies; 2+ messages in thread
From: Tom de Vries @ 2018-05-09 16:08 UTC (permalink / raw)
  To: Jakub Jelinek, Thomas Schwinge; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

On 11/17/2017 09:45 AM, Tom de Vries wrote:
> Hi,
> 
> GOACC_enter_exit_data has this prototype:
> ...
> void
> GOACC_enter_exit_data (int device, size_t mapnum,
>                         void **hostaddrs, size_t *sizes,
>                         unsigned short *kinds,
>                         int async, int num_waits, ...)
> ...
> 
> And GOACC_declare calls GOACC_enter_exit_data with async arg zero:
> ...
>            case GOMP_MAP_DELETE:
>              GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
>                                     &kinds[i], 0, 0);
> ...
> 
> Async arg zero means some async queue (see openacc 2.0a, 2.14.1 "async 
> clause" for more details).
> 
> The declare directive has no async clause, so the arg should be 
> GOMP_ASYNC_SYNC.
> 
> Tested libgomp testsuite on x86_64 with nvptx accelerator.
> 
> OK for trunk?

Assuming no objections, committed to trunk as attached.

Thanks,
- Tom

[-- Attachment #2: 0001-openacc-libgomp-Use-GOMP_ASYNC_SYNC-in-GOACC_declare.patch --]
[-- Type: text/x-patch, Size: 1476 bytes --]

[openacc, libgomp] Use GOMP_ASYNC_SYNC in GOACC_declare

2018-05-09  Tom de Vries  <tom@codesourcery.com>

	PR libgomp/82901
	* oacc-parallel.c (GOACC_declare): Use GOMP_ASYNC_SYNC as async argument
	to GOACC_enter_exit_data.

---
 libgomp/oacc-parallel.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libgomp/oacc-parallel.c b/libgomp/oacc-parallel.c
index a71b399..f270491 100644
--- a/libgomp/oacc-parallel.c
+++ b/libgomp/oacc-parallel.c
@@ -524,7 +524,7 @@ GOACC_declare (int device, size_t mapnum,
 	  case GOMP_MAP_POINTER:
 	  case GOMP_MAP_DELETE:
 	    GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
-				   &kinds[i], 0, 0);
+				   &kinds[i], GOMP_ASYNC_SYNC, 0);
 	    break;
 
 	  case GOMP_MAP_FORCE_DEVICEPTR:
@@ -533,19 +533,19 @@ GOACC_declare (int device, size_t mapnum,
 	  case GOMP_MAP_ALLOC:
 	    if (!acc_is_present (hostaddrs[i], sizes[i]))
 	      GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
-				     &kinds[i], 0, 0);
+				     &kinds[i], GOMP_ASYNC_SYNC, 0);
 	    break;
 
 	  case GOMP_MAP_TO:
 	    GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
-				   &kinds[i], 0, 0);
+				   &kinds[i], GOMP_ASYNC_SYNC, 0);
 
 	    break;
 
 	  case GOMP_MAP_FROM:
 	    kinds[i] = GOMP_MAP_FORCE_FROM;
 	    GOACC_enter_exit_data (device, 1, &hostaddrs[i], &sizes[i],
-				   &kinds[i], 0, 0);
+				   &kinds[i], GOMP_ASYNC_SYNC, 0);
 	    break;
 
 	  case GOMP_MAP_FORCE_PRESENT:

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-09 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-17  9:13 [PATCH, libgomp, openacc] Use GOMP_ASYNC_SYNC in GOACC_declare Tom de Vries
2018-05-09 16:08 ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).