Skip to content

Commit 63505ad

Browse files
authored
[TorchToLinalg] Drop constexpr from ifs in argmin/max.dim (#2617)
MSVC-19 does not support constexprs of lambda captured constexpr values like this: https://godbolt.org/z/ej65rMzdr Instead, this just drops the constexpr from the if statements. See the discussion in https://discord.com/channels/689900678990135345/1062405112292712499/1182338050664185999
1 parent 141202b commit 63505ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Conversion/TorchToLinalg/Reduction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class ConvertAtenMinMaxDimOp : public OpConversionPattern<OpTy> {
187187
Value resultVal, predicate;
188188
if (inElementType.isa<mlir::FloatType>()) {
189189
arith::CmpFPredicate predType;
190-
if constexpr (isMax) {
190+
if (isMax) {
191191
predType = arith::CmpFPredicate::OGT;
192192
resultVal = rewriter.create<arith::MaximumFOp>(
193193
nestedLoc, newValue, oldValue);
@@ -201,7 +201,7 @@ class ConvertAtenMinMaxDimOp : public OpConversionPattern<OpTy> {
201201
newValue, oldValue);
202202
} else {
203203
arith::CmpIPredicate predType;
204-
if constexpr (isMax) {
204+
if (isMax) {
205205
predType = arith::CmpIPredicate::sgt;
206206
resultVal = rewriter.create<arith::MaxSIOp>(nestedLoc, newValue,
207207
oldValue);

0 commit comments

Comments
 (0)