On 07/02/2025 09:40, Tobias Burnus wrote:
This patch is part of the following series (all unreviewed so far)
but can be independently applied:

* [Patch] [gcn] Fix gfx906's sramecc setting,
   https://gcc.gnu.org/pipermail/gcc-patches/2025-February/675251.html

* "[gcn] Add gfx9-generic and generic-associated gfx*"
  (email subject: "Re: [Patch] [GCN] Handle generic ISA names in libgomp's plugin-gcn.c";    this thread), https://gcc.gnu.org/pipermail/gcc-patches/2025- February/675259.html

* * *

This patch permits loading generic ISA code objects - by just
trying whether the runtime accepts it.  If not, it fails with
an error. - The error messages should be a bit more helpful in
some cases as before.


OK for mainline?


This becomes useful by configuring a gfx*-generic multilib,
once ROCR ("ROCm") support it; thus, this is a future proof
patch.

* * *

Note: This currently fails with all ROCm <= 6.3.2 as those
either don't recognize the generic ISA code or do not support
generic resolution. However, it looks as if one of the next
ROCm (AOMP?) releases will do.

Note 2: As the generic ISA is not yet supported, this patch does
not suggest compiling with -march=gfx*-generic, yet.

Note 3: The patch series is based on it (with some modifications):
https://gcc.gnu.org/pipermail/gcc-patches/2025-February/675200.html
that also has this -march= diagnostic.

Tobias

+
+  /* Either nongeneric and mismatch of the ISA - or generic but
+     not handled by the ROCm (e.g. because it is too old).  */
+

/* If we get here, either the binary is non-generic ....

+    snprintf (msg, sizeof msg,
+             "GCN code object ISA '%s' is incompatile to GPU ISA '%s' "
+             "(device %d).\n"

Spelling of "incompatible", and s/to/with/. In two places.

Also I think all the sentences should finish with '.'.

-      if (!isa_matches_agent (agent, image))
+      if (!isa_matches_agent (agent, image, HSA_STATUS_SUCCESS))
        goto fail;

/* Check the ISA early because older ROCm had unhelpful errors.  */

Andrew

Reply via email to