Hi!

On Fri, 13 Sep 2013 15:29:30 +0400, "Michael V. Zolotukhin" 
<michael.v.zolotuk...@gmail.com> wrote:
> Here is the first patch for adding plugins support in libgomp - could you 
> please
> take a look at it?

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

> +/* This structure describes accelerator device.
> +   It contains name of the corresponding libgomp plugin, function handlers 
> for
> +   interaction with the device, ID-number of the device, and information 
> about
> +   mapped memory.  */
> +struct gomp_device_descr
> +{
> +  /* This is the ID number of device.  It could be specified in 
> DEVICE-clause of
> +     TARGET construct.  */
> +  int id;

Committed to gomp-4_0-branch in r219028:

commit dac5fae7f58dab3c3f271d2676d20aa653a51e9a
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Dec 22 18:24:03 2014 +0000

    libgomp: Remove id member from struct gomp_device_descr.
    
    This ID field is not actually used anywhere, and it is redundant, because 
all
    devices are kept in a devices array, so the IDth device is simply 
devices[ID].
    
        libgomp/
        * libgomp.h (struct gomp_device_descr): Remove id member.  Update
        all users.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@219028 
138bc75d-0d04-0410-961f-82ee72b054a4
---
 libgomp/ChangeLog.gomp | 3 +++
 libgomp/libgomp.h      | 4 ----
 libgomp/oacc-host.c    | 1 -
 libgomp/target.c       | 3 ---
 4 files changed, 3 insertions(+), 8 deletions(-)

diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp
index 3439797..eabf737 100644
--- libgomp/ChangeLog.gomp
+++ libgomp/ChangeLog.gomp
@@ -1,5 +1,8 @@
 2014-12-22  Thomas Schwinge  <tho...@codesourcery.com>
 
+       * libgomp.h (struct gomp_device_descr): Remove id member.  Update
+       all users.
+
        * libgomp.h (gomp_init_tables): Remove const qualifier from struct
        gomp_device_descr.  Change all users.
        * oacc-int.h (base_dev, goacc_register): Likewise.
diff --git libgomp/libgomp.h libgomp/libgomp.h
index 440bfce..b6d216b 100644
--- libgomp/libgomp.h
+++ libgomp/libgomp.h
@@ -736,10 +736,6 @@ struct gomp_device_descr
   /* Capabilities of device (supports OpenACC, OpenMP).  */
   unsigned int capabilities;
 
-  /* This is the ID number of device.  It could be specified in DEVICE-clause 
of
-     TARGET construct.  */
-  int id;
-
   /* This is the ID number of device among devices of the same type.  */
   int target_id;
 
diff --git libgomp/oacc-host.c libgomp/oacc-host.c
index 3b90259..2a82517 100644
--- libgomp/oacc-host.c
+++ libgomp/oacc-host.c
@@ -38,7 +38,6 @@ static struct gomp_device_descr host_dispatch =
     .capabilities = (GOMP_OFFLOAD_CAP_OPENACC_200
                     | GOMP_OFFLOAD_CAP_NATIVE_EXEC
                     | GOMP_OFFLOAD_CAP_SHARED_MEM),
-    .id = 0,
 
     .is_initialized = false,
     .offload_regions_registered = false,
diff --git libgomp/target.c libgomp/target.c
index d823045..226b95b 100644
--- libgomp/target.c
+++ libgomp/target.c
@@ -1108,7 +1108,6 @@ gomp_target_init (void)
                current_device.openacc.target_data = NULL;
                for (i = 0; i < new_num_devices; i++)
                  {
-                   current_device.id = num_devices + 1;
                    current_device.target_id = i;
                    devices[num_devices] = current_device;
                    gomp_mutex_init (&devices[num_devices].mem_map.lock);
@@ -1136,9 +1135,7 @@ gomp_target_init (void)
                {
                  struct gomp_device_descr device_tmp = devices[d];
                  devices[d] = devices[i];
-                 devices[d].id = d + 1;
                  devices[i] = device_tmp;
-                 devices[i].id = i + 1;
 
                  break;
                }


Grüße,
 Thomas

Attachment: signature.asc
Description: PGP signature

Reply via email to