public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-9396] nvptx: 'cuDeviceGetCount' failure is fatal
Date: Fri,  8 Mar 2024 15:36:07 +0000 (GMT)	[thread overview]
Message-ID: <20240308153607.4A8F8385DC0F@sourceware.org> (raw)

https://gcc.gnu.org/g:37078f241a22c45db6380c5e9a79b4d08054bb3d

commit r14-9396-g37078f241a22c45db6380c5e9a79b4d08054bb3d
Author: Thomas Schwinge <tschwinge@baylibre.com>
Date:   Thu Mar 7 13:18:23 2024 +0100

    nvptx: 'cuDeviceGetCount' failure is fatal
    
    Per commit 683f11843974f0bdf42f79cdcbb0c2b43c7b81b0
    "OpenMP: Move omp requires checks to libgomp", we're now using 'return -1'
    from 'GOMP_OFFLOAD_get_num_devices' for 'omp_requires_mask' purposes.  This
    missed that via 'nvptx_get_num_devices', we could also 'return -1' for
    'cuDeviceGetCount' failure.  Before, this meant (in 'gomp_target_init') to
    silently ignore the plugin/device -- which also has been doubtful behavior.
    Let's instead turn 'cuDeviceGetCount' failure into a fatal error, similar to
    other errors during device initialization.
    
            libgomp/
            * plugin/plugin-nvptx.c (nvptx_get_num_devices):
            'cuDeviceGetCount' failure is fatal.

Diff:
---
 libgomp/plugin/plugin-nvptx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index 2bc7b850671..ced6e014ece 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -612,7 +612,7 @@ nvptx_get_num_devices (void)
 	}
     }
 
-  CUDA_CALL_ERET (-1, cuDeviceGetCount, &n);
+  CUDA_CALL_ASSERT (cuDeviceGetCount, &n);
   return n;
 }

                 reply	other threads:[~2024-03-08 15:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240308153607.4A8F8385DC0F@sourceware.org \
    --to=tschwinge@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).