fixing refactored global read offsets
@@ -1285,7 +1285,6 @@ class KernelWriter:
####################################
# end loop
- if kernel["ProblemType"]["NumIndicesSummation"] > 1:
for i in reversed(range(0,kernel["ProblemType"]["NumIndicesSummation"])):
loopChar = indexChars[kernel["ProblemType"]["IndicesSummation"][i]]
@@ -1309,15 +1308,22 @@ class KernelWriter:
# global read addresses b
for perp in range(0, kernel["NumLoadsPerpendicularB"]):
for para in range(0, kernel["NumLoadsCoalescedB"]):
- kStr += "%sglobalReadB_%u_%u += ((%s) strideB%s" \
- % (indent, parap, perp, self.int64Str, loopChar)
+ for s in range(0, kernel["VectorWidth"]):
+ kStr += "%sglobalReadB_%u_%u%s += (%s) strideB%s" \
+ % (indent, para, perp, \
+ (("_s%u"%s) if kernel["VectorWidth"]>1 else ""), \
+ self.int64Str, loopChar)
if i==kernel["ProblemType"]["NumIndicesSummation"]-1:
kStr += "*DEPTHU"
else:
- for j in range(i+1,min(i+2,kernel["ProblemType"]["NumIndicesSummation"]) ):
- tmpChar = indexChars[kernel["ProblemType"]["IndicesSummation"][j]]
+ for j in range(i+1,min(i+2, \
+ kernel["ProblemType"]["NumIndicesSummation"]) ):
+ tmpChar = \
+ indexChars[kernel["ProblemType"]["IndicesSummation"][j]]
kStr += " - strideB" + tmpChar + "*size" + tmpChar
- kStr += ")/VECTOR_WIDTH;" + self.endLine
+ kStr += ";" + self.endLine
+
+
########################################
# close loop
