File 0004-generic-arches-need-a-solution-index.patch of Package rocblas
From 71f280ea73630c0453fda896a36d0b3092b95aed Mon Sep 17 00:00:00 2001
From: Tom Rix <Tom.Rix@amd.com>
Date: Sun, 8 Mar 2026 16:21:07 -0700
Subject: [PATCH 4/6] generic arches need a solution index
So there is no overlap with the regular gpu indecies, pick
a shift value that does not overlap.
(9 << 29) >> 18 = 18432
Signed-off-by: Tom Rix <Tom.Rix@amd.com>
---
shared/tensile/Tensile/SolutionLibrary.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/shared/tensile/Tensile/SolutionLibrary.py b/shared/tensile/Tensile/SolutionLibrary.py
index 0c7b6428d624..e7c4b7457737 100644
--- a/shared/tensile/Tensile/SolutionLibrary.py
+++ b/shared/tensile/Tensile/SolutionLibrary.py
@@ -255,7 +255,7 @@ class MasterSolutionLibrary:
"""Maps hex characters from gfx name to an index.
Given a gfx name of the form gfx[0-9a-f]*, map the characters following
- gfx from hex to int and left shift the integer by 18.
+ gfx from hex to int and left shift the integer by 18 (or 29 for generic architectures).
Args:
architectureName: The gfx name (or fallback).
@@ -273,7 +273,12 @@ class MasterSolutionLibrary:
archString = re.search('(?<=gfx)[0-9a-f]*', architectureName)
if archString is not None:
archLiteral = archString.group(0)
- archval = (int(archLiteral, 16) << 18)
+ # Use left shift of 29 for generic architectures, 18 otherwise
+ if architectureName.endswith("-generic"):
+ shift_bits = 29
+ else:
+ shift_bits = 18
+ archval = (int(archLiteral, 16) << shift_bits)
# Check for duplicate architecture values
if archval >= 0 and not archval in cls.ArchitectureSet:
cls.ArchitectureSet.add(archval)
--
2.53.0