]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgomp: Save OpenMP device number when initializing the interop object
authorTobias Burnus <tburnus@baylibre.com>
Mon, 24 Mar 2025 18:52:10 +0000 (19:52 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Mon, 24 Mar 2025 19:00:00 +0000 (20:00 +0100)
The interop object (opaque object to the user, used internally in libgomp)
already had a 'device_num' member, but it was missed to actually set it.

libgomp/ChangeLog:

* target.c (gomp_interop_internal): Set the 'device_num' member
when initializing an interop object.

(cherry picked from commit 4d5d1a7326c8509a4a6fc94eedc3ba22d68f806f)

libgomp/target.c

index 2647c3864c22128c349d6747150fb2bcf454128d..bdba51e30037dcc0e08a2c28b5eaa01db083aeb5 100644 (file)
@@ -5911,6 +5911,7 @@ gomp_interop_internal (void *data)
            }
          *obj =
            (struct interop_obj_t *) calloc (1, sizeof (struct interop_obj_t));
+         (*obj)->device_num = devicep->target_id;
          devicep->interop_func (*obj, devicep->target_id,
                                 gomp_interop_flag_init, targetsync,
                                 prefer_type);