Skip to content

Commit

Permalink
Fix F16 -> F32 upcasting to support Pascal GPUs
Browse files Browse the repository at this point in the history
Based on code from #2780 provided by @wkpark
  • Loading branch information
sasha0552 authored May 10, 2024
1 parent 84b8e5f commit dd5e1d1
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,15 @@ struct FpToFpOpConversion
return outVals;
}

if (srcElementType.isF16() && dstElementType.isF32()) {
SmallVector<Value> outVals;
for (Value v : operands[0]) {
outVals.push_back(
convertFp16ToFp32(loc, rewriter, v));
}
return outVals;
}

if (srcElementType.isF32() && dstElementType.isBF16()) {
assert(roundingMode.has_value() &&
"rounding mode must be specified for fp32->bf16 conversion");
Expand Down

0 comments on commit dd5e1d1

Please sign in to comment.