modify existing MAX, remove new MAC_HPA
@@ -366,11 +366,12 @@ class KernelWriterSource(KernelWriter):
if self.language == "OCL":
kStr += "#define MAC(A,B,DST) mad(A,B,DST)"
+ else:
+ if kernel["ProblemType"]["HighPrecisionAccumulate"] and kernel["ProblemType"]["DataType"].isHalf():
+ kStr += "#define MAC(A,B,DST) DST += static_cast<float>(A) * static_cast<float>(B)"
else:
kStr += "#define MAC(A,B,DST) DST += A*B"
kStr += self.endLine
- kStr += "#define MAC_HPA(A,B,DST) DST += static_cast<float>(A) * static_cast<float>(B)"
- kStr += self.endLine
if self.language == "HIP" and kernel["ProblemType"]["DataType"].isComplex():
kStr += "#define s0 x" + self.endLine
@@ -466,8 +467,8 @@ class KernelWriterSource(KernelWriter):
if ((kernel["ThreadTileA"] % 2 == 0) and (kernel["ProblemType"]["DataType"].isHalf())):
if kernel["ProblemType"]["HighPrecisionAccumulate"]:
kStr += "#define TYPE_MAC(MULA0,MULB0,DST0,MULA1,MULB1,DST1) " + self.endLinePP
- kStr += " DST0 = MAC_HPA(MULA0,MULB0,DST0);" + self.endLinePP
- kStr += " DST1 = MAC_HPA(MULA1,MULB1,DST1);" + self.endLinePP
+ kStr += " DST0 = MAC(MULA0,MULB0,DST0);" + self.endLinePP
+ kStr += " DST1 = MAC(MULA1,MULB1,DST1);" + self.endLinePP
kStr += self.endLine
else:
kStr += "#define TYPE_MAC(MULA0,MULB0,DST0,MULA1,MULB1,DST1) " + self.endLinePP
