From: Kwok Cheung Yeung <kcyeung77@gmail.com>
To: pa@codesourcery.com
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH][OG12] amdgcn: Support AMD-specific 'isa' and 'arch' traits in OpenMP context selectors
Date: Wed, 30 Nov 2022 18:50:30 +0000 [thread overview]
Message-ID: <202ee18b-90c8-830b-82a5-b705a9ec5c73@gmail.com> (raw)
In-Reply-To: <e929111e-d5f2-8ed3-c3ec-f1280615d8fc@codesourcery.com>
Hello PA,
> --- libgomp/config/gcn/selector.c
> +++ libgomp/config/gcn/selector.c
> @@ -36,7 +36,7 @@ GOMP_evaluate_current_device (const char *kind, const char *arch,
> if (kind && strcmp (kind, "gpu") != 0)
> return false;
>
> - if (arch && strcmp (arch, "gcn") != 0)
> + if (arch && (strcmp (arch, "gcn") != 0 || strcmp (arch, "amdgcn") != 0))
> return false;
The logic here looks wrong to me - surely it should return false if arch
is not 'gcn' AND it is not 'amdgcn'?
> @@ -48,8 +48,17 @@ GOMP_evaluate_current_device (const char *kind, const char *arch,
> #endif
>
> #ifdef __GCN5__
> - if (strcmp (isa, "gfx900") == 0 || strcmp (isa, "gfx906") != 0
> - || strcmp (isa, "gfx908") == 0)
> + if (strcmp (isa, "gfx900") == 0 || strcmp (isa, "gfx906") != 0)
> + return true;
> +#endif
> +
> +#ifdef __CDNA1__
> + if (strcmp (isa, "gfx908") == 0)
> + return true;
> +#endif
> +
> +#ifdef __CDNA2__
> + if (strcmp (isa, "gfx90a") == 0)
> return true;
> #endif
Okay for gfx908 and gfx90a, but is there any way of distinguishing
between 'gfx900' and 'gfx906' ISAs? I don't think these are mutually
compatible.
Thanks
Kwok
next prev parent reply other threads:[~2022-11-30 18:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 15:32 Paul-Antoine Arras
2022-11-30 18:50 ` Kwok Cheung Yeung [this message]
2022-12-01 11:10 ` Paul-Antoine Arras
2022-12-01 12:45 ` Andrew Stubbs
2022-12-01 14:35 ` [PATCH] amdgcn: Add preprocessor builtins for every processor type Paul-Antoine Arras
2022-12-01 14:42 ` Andrew Stubbs
2022-12-01 15:48 ` [PATCH][OG12] amdgcn: Support AMD-specific 'isa' and 'arch' traits in OpenMP context selectors Paul-Antoine Arras
2022-12-02 16:51 ` Kwok Cheung Yeung
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=202ee18b-90c8-830b-82a5-b705a9ec5c73@gmail.com \
--to=kcyeung77@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=pa@codesourcery.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).