public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kwok Cheung Yeung <kcy@codesourcery.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH] openmp: Add support for target_device selector set in metadirectives
Date: Wed, 26 Jan 2022 14:21:58 +0000	[thread overview]
Message-ID: <94ef963f-0db0-ee32-2f48-9ee2e811d4b0@codesourcery.com> (raw)
In-Reply-To: <b292dea4-4b5d-4ef4-75f8-0a6f19c8b807@codesourcery.com>

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

Hello

Just noticed a bug in the ISA checking in the nvptx plugin - the minor 
version should only be compared if the major version is equal, otherwise 
it would reject an isa of sm_35 if the card is capable of supporting 
sm_52, for example. This patch fixes the issue.

Thanks

Kwok

[-- Attachment #2: nvptx_isa_fix.diff --]
[-- Type: text/plain, Size: 625 bytes --]

diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index 7427677e69d..86a12c3fcfd 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -2047,7 +2047,8 @@ GOMP_OFFLOAD_run (int ord, void *tgt_fn, void *tgt_vars, void **args)
 /* TODO: Implement GOMP_OFFLOAD_async_run. */
 
 #define CHECK_ISA(major, minor) \
-  if (device->compute_major >= major && device->compute_minor >= minor \
+  if (((device->compute_major == major && device->compute_minor >= minor) \
+       || device->compute_major > major) \
       && strcmp (isa, "sm_"#major#minor) == 0) \
     return true
 

      reply	other threads:[~2022-01-26 14:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24 21:35 Kwok Cheung Yeung
2022-01-26 14:21 ` Kwok Cheung Yeung [this message]

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=94ef963f-0db0-ee32-2f48-9ee2e811d4b0@codesourcery.com \
    --to=kcy@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.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).