fixed local split u for new vector code
@@ -1774,10 +1774,11 @@ class KernelWriterSource(KernelWriter):
for j in range(0, kernel["ThreadTile1"]/kernel["VectorWidth"]):
for i in range(0, kernel["ThreadTile0"]/kernel["VectorWidth"]):
for s in range(0, kernel["VectorWidth"]):
- kStr += "%slocalLocalSplitU[lr%s + %u*SG%s + MT%s*(lr%s*VECTOR_WIDTH + %u + SG%s*VECTOR_WIDTH*%u) + (MT%s*MT%s)*sgId] = rC[%u+%u*TT%s+%u*TT%s*VECTOR_WIDTH];%s" \
- % (self.indent, self.tileChar0, i, self.tileChar0, \
+ for vc in range(0, kernel["VectorWidth"]):
+ kStr += "%slocalLocalSplitU[%u + (lr%s + %u*SG%s + (MT%s/VECTOR_WIDTH)*(lr%s*VECTOR_WIDTH + %u + SG%s*VECTOR_WIDTH*%u) + (MT%s*MT%s/VECTOR_WIDTH)*sgId)*VECTOR_WIDTH] = rC[%u + (%u+%u*(TT%s/VECTOR_WIDTH)+%u*TT%s)*VECTOR_WIDTH];%s" \
+ % (self.indent, vc, self.tileChar0, i, self.tileChar0, \
self.tileChar0, self.tileChar1, \
- s, self.tileChar1, j, self.tileChar0, self.tileChar1, i, s, \
+ s, self.tileChar1, j, self.tileChar0, self.tileChar1, vc, i, s, \
self.tileChar0, j, self.tileChar0, self.endLine)
kStr += self.indent + self.syncStr + self.endLine
"""
@@ -1810,7 +1811,7 @@ class KernelWriterSource(KernelWriter):
for i in range(0, kernel["NumVectorsPerThread"]):
for s in range(0, kernel["VectorWidth"]):
kStr += " rC[%u + %3u*VECTOR_WIDTH] += localLocalSplitU[(%u + serial*VECTOR_WIDTH+%u*NUM_THREADS*VECTOR_WIDTH + %u*MT%s*MT%s)];%s" \
- % (s, i, i, s, r, self.tileChar0, self.tileChar1, self.endLine)
+ % (s, i, s, i, r, self.tileChar0, self.tileChar1, self.endLine)
kStr += self.endLine
return kStr
@@ -1863,7 +1864,7 @@ class KernelWriterSource(KernelWriter):
kStr += ", (%s)" % self.uint64Str
kStr += ") ]"
kStr += ", alpha"
- kStr += ", rC[%u + %u*VECTOR_WIDTH]" % (b, s )
+ kStr += ", rC[%u + %u*VECTOR_WIDTH]" % (s, b )
if kernel["ProblemType"]["UseBeta"]:
kStr += ", beta"
