public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6735] libgomp, OpenMP: Fix issue for omp_get_device_num on gcn targets.
@ 2022-01-19 13:09 Marcel Vollweiler
  0 siblings, 0 replies; only message in thread
From: Marcel Vollweiler @ 2022-01-19 13:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0bd247bbbe4cf396173f09eeec37e116e98f8471

commit r12-6735-g0bd247bbbe4cf396173f09eeec37e116e98f8471
Author: Marcel Vollweiler <marcel@codesourcery.com>
Date:   Wed Jan 19 05:03:54 2022 -0800

    libgomp, OpenMP: Fix issue for omp_get_device_num on gcn targets.
    
    Currently omp_get_device_num does not work on gcn targets with more than one
    offload device. The reason is that GOMP_DEVICE_NUM_VAR is static in
    icv-device.c and thus "__gomp_device_num" is not visible in the offload image.
    
    This patch removes "static" such that "__gomp_device_num" is now part of the
    offload image and can now be found in GOMP_OFFLOAD_load_image in the plugin.
    
    This is not an issue for nvptx. There, "__gomp_device_num" is in the offload
    image even with "static".
    
    libgomp/ChangeLog:
    
            * config/gcn/icv-device.c: Make GOMP_DEVICE_NUM_VAR public (remove
            "static") to make the device num available in the offload image.

Diff:
---
 libgomp/config/gcn/icv-device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgomp/config/gcn/icv-device.c b/libgomp/config/gcn/icv-device.c
index fcfa0f39cd8..f70b7e6de07 100644
--- a/libgomp/config/gcn/icv-device.c
+++ b/libgomp/config/gcn/icv-device.c
@@ -60,7 +60,7 @@ omp_is_initial_device (void)
 
 /* This is set to the device number of current GPU during device initialization,
    when the offload image containing this libgomp portion is loaded.  */
-static volatile int GOMP_DEVICE_NUM_VAR;
+volatile int GOMP_DEVICE_NUM_VAR;
 
 int
 omp_get_device_num (void)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-19 13:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 13:09 [gcc r12-6735] libgomp, OpenMP: Fix issue for omp_get_device_num on gcn targets Marcel Vollweiler

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).