public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>
Cc: Julian Brown <julian@codesourcery.com>
Subject: Re: [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost)
Date: Mon, 22 Dec 2014 18:12:00 -0000	[thread overview]
Message-ID: <87r3vry2zl.fsf@kepler.schwinge.homeip.net> (raw)
In-Reply-To: <20141111135323.29e0f27b@octopus>

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

Hi!

On Tue, 11 Nov 2014 13:53:23 +0000, Julian Brown <julian@codesourcery.com> wrote:
> On Tue, 23 Sep 2014 19:19:31 +0100
> Julian Brown <julian@codesourcery.com> wrote:
> > This patch contains the bulk of the OpenACC 2.0 runtime support,
> > building around, or on top of, the OpenMP 4.0 support (as previously
> > posted or already extant upstream) where we could. [...]
> 
> Here is a new version of the OpenACC support patch for libgomp, [...]

> --- a/libgomp/libgomp_target.h
> +++ b/libgomp/libgomp_target.h

> +extern attribute_hidden void
> +gomp_free_memmap (struct gomp_device_descr *devicep);

> --- a/libgomp/target.c
> +++ b/libgomp/target.c

> +attribute_hidden void
> +gomp_free_memmap (struct gomp_device_descr *devicep)
> +{
> +  struct gomp_memory_mapping *mm = &devicep->mem_map;
> +
> +  while (mm->splay_tree.root)
> +    {
> +      struct target_mem_desc *tgt = mm->splay_tree.root->key.tgt;
> +      
> +      splay_tree_remove (&mm->splay_tree, &mm->splay_tree.root->key);
> +      free (tgt->array);
> +      free (tgt);
> +    }
> +
> +  mm->is_initialized = false;
> +}

Committed to gomp-4_0-branch in r219025:

commit 2eb33739d20c07303c42ed56db0fb925b575f33e
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Dec 22 18:04:41 2014 +0000

    libgomp: gomp_free_memmap interface change.
    
    	libgomp/
    	* libgomp.h (gomp_free_memmap): Take a pointer to a struct
    	gomp_memory_mapping instead of a pointer to a struct
    	gomp_device_descr.  Change all users.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@219025 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libgomp/ChangeLog.gomp | 4 ++++
 libgomp/libgomp.h      | 4 ++--
 libgomp/oacc-init.c    | 2 +-
 libgomp/target.c       | 4 +---
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp
index 4eac98c..383993d 100644
--- libgomp/ChangeLog.gomp
+++ libgomp/ChangeLog.gomp
@@ -1,5 +1,9 @@
 2014-12-22  Thomas Schwinge  <thomas@codesourcery.com>
 
+	* libgomp.h (gomp_free_memmap): Take a pointer to a struct
+	gomp_memory_mapping instead of a pointer to a struct
+	gomp_device_descr.  Change all users.
+
 	* libgomp.h (struct gomp_device_descr): Move target_data member...
 	(struct acc_dispatch_t): ... into here.  Change all users.
 
diff --git libgomp/libgomp.h libgomp/libgomp.h
index ec3c52e..5897d8f 100644
--- libgomp/libgomp.h
+++ libgomp/libgomp.h
@@ -790,10 +790,10 @@ extern void gomp_init_device (struct gomp_device_descr *);
 extern void gomp_init_tables (const struct gomp_device_descr *,
 			      struct gomp_memory_mapping *);
 
+extern void gomp_free_memmap (struct gomp_memory_mapping *);
+
 extern void gomp_fini_device (struct gomp_device_descr *);
 
-extern void gomp_free_memmap (struct gomp_device_descr *);
-
 /* work.c */
 
 extern void gomp_init_work_share (struct gomp_work_share *, bool, unsigned);
diff --git libgomp/oacc-init.c libgomp/oacc-init.c
index 06039b3..3867ca7 100644
--- libgomp/oacc-init.c
+++ libgomp/oacc-init.c
@@ -350,7 +350,7 @@ acc_shutdown_1 (acc_device_t d)
 
 	  walk->dev->openacc.target_data = target_data = NULL;
 
-	  gomp_free_memmap (walk->dev);
+	  gomp_free_memmap (&walk->dev->mem_map);
 
 	  walk->dev = NULL;
 	}
diff --git libgomp/target.c libgomp/target.c
index bf719f8..788d9fb 100644
--- libgomp/target.c
+++ libgomp/target.c
@@ -722,10 +722,8 @@ gomp_init_dev_tables (struct gomp_device_descr *devicep)
 
 
 attribute_hidden void
-gomp_free_memmap (struct gomp_device_descr *devicep)
+gomp_free_memmap (struct gomp_memory_mapping *mm)
 {
-  struct gomp_memory_mapping *mm = &devicep->mem_map;
-
   while (mm->splay_tree.root)
     {
       struct target_mem_desc *tgt = mm->splay_tree.root->key.tgt;


Grüße,
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  parent reply	other threads:[~2014-12-22 18:05 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 18:20 [PATCH 7/10] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin Julian Brown
2014-11-11 13:54 ` [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost) Julian Brown
2014-11-12 10:10   ` Jakub Jelinek
2014-11-12 10:59     ` Thomas Schwinge
2014-11-12 21:11       ` Mike Stump
2014-11-12 11:06     ` Julian Brown
2014-11-12 11:15       ` Jakub Jelinek
2014-11-12 11:33     ` libgomp: "GNU OpenMP Runtime Library" (was: [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost)) Thomas Schwinge
2014-11-12 11:49       ` Jakub Jelinek
2014-11-12 13:40         ` David Malcolm
2014-11-12 13:49           ` Jakub Jelinek
2014-11-12 20:30             ` David Malcolm
2014-11-12 20:41               ` Jakub Jelinek
2014-11-12 20:50                 ` David Malcolm
2015-01-11  2:18                   ` libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library (was: libgomp: "GNU OpenMP Runtime Library") Thomas Schwinge
2015-01-29 10:25                     ` Thomas Schwinge
2019-05-28 21:27                       ` libgomp: long known as the GNU Offloading and Multi Processing Runtime Library (was: libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library (was: libgomp: "GNU OpenMP Runtime Library")) Thomas Schwinge
     [not found]     ` <20141113232615.4ff373bf@octopus>
2014-11-14 16:07       ` Fortran/C interfacing (was: [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost)) Thomas Schwinge
2014-11-14 21:01         ` Fortran/C interfacing Tobias Burnus
2014-11-14 21:24           ` Jakub Jelinek
2014-11-14 16:38     ` GOMP_DEBUG environment variable? (was: [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost)) Thomas Schwinge
2014-11-15  1:04     ` [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost) Julian Brown
2014-11-19 19:58       ` Bernd Schmidt
2014-11-19 20:39         ` Cesar Philippidis
2014-12-22 17:55   ` Thomas Schwinge
2014-12-22 18:05   ` Thomas Schwinge
2014-12-22 18:12   ` Thomas Schwinge [this message]
2014-12-22 18:16   ` Thomas Schwinge
2014-12-22 18:55   ` Thomas Schwinge
2014-12-23  0:57   ` Thomas Schwinge
2014-12-22 16:41 ` [PATCH 7/10] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin Thomas Schwinge
2015-01-12 14:49 ` Thomas Schwinge
2015-01-12 15:07   ` Thomas Schwinge
2015-01-12 15:00 ` Thomas Schwinge
2017-02-02 14:38 ` libgomp, nvptx plugin: Make "nvptx_exec" static (was: [PATCH 7/10] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin) Thomas Schwinge
2022-05-12 11:32 ` libgomp plugins: Don't 'AC_SUBST' and 'AC_DEFINE_UNQUOTED' for 'PLUGIN_GCN', 'PLUGIN_NVPTX' " Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r3vry2zl.fsf@kepler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=julian@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).