Skip to content

Commit

Permalink
fix GSU bug: PostGSU kernel refer to Nan data of C matrix even when b…
Browse files Browse the repository at this point in the history
…eta is zero (#1217)
  • Loading branch information
jichangjichang authored Nov 9, 2020
1 parent 28e22be commit ab44bf4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Tensile/KernelWriterConversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,13 @@ def kernelBody(self):
kStr += " idxW += strideW;%s" % self.endLine
kStr += " }%s" % self.endLine

kStr += " if( beta == (%s)0)%s" % (self.state["ProblemType"]["ComputeDataType"].toDevice(self.language), self.endLine)
kStr += " accum = ((float)alpha) * accum;%s" % (self.endLine)
kStr += " else%s" % self.endLine
kStr += " accum = (((float)alpha) * accum + ((float)beta) * ((float)C[idxC]));%s" % (self.endLine)

typeStr = self.state["ProblemType"]["DestDataType"].toDevice(self.language)
kStr += " D[idxD] = (%s)(((float)alpha) * accum + ((float)beta) * ((float)C[idxC])); %s" % (typeStr, self.endLine)
kStr += " D[idxD] = (%s)accum;%s" % (typeStr, self.endLine)

########################################
# end
Expand Down

0 comments on commit ab44bf4

Please sign in to comment.