mirror of https://github.com/llvm/torch-mlir
[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/1182338050664185999pull/2623/head
parent
141202bc01
commit
63505ad6b2
|
@ -187,7 +187,7 @@ public:
|
||||||
Value resultVal, predicate;
|
Value resultVal, predicate;
|
||||||
if (inElementType.isa<mlir::FloatType>()) {
|
if (inElementType.isa<mlir::FloatType>()) {
|
||||||
arith::CmpFPredicate predType;
|
arith::CmpFPredicate predType;
|
||||||
if constexpr (isMax) {
|
if (isMax) {
|
||||||
predType = arith::CmpFPredicate::OGT;
|
predType = arith::CmpFPredicate::OGT;
|
||||||
resultVal = rewriter.create<arith::MaximumFOp>(
|
resultVal = rewriter.create<arith::MaximumFOp>(
|
||||||
nestedLoc, newValue, oldValue);
|
nestedLoc, newValue, oldValue);
|
||||||
|
@ -201,7 +201,7 @@ public:
|
||||||
newValue, oldValue);
|
newValue, oldValue);
|
||||||
} else {
|
} else {
|
||||||
arith::CmpIPredicate predType;
|
arith::CmpIPredicate predType;
|
||||||
if constexpr (isMax) {
|
if (isMax) {
|
||||||
predType = arith::CmpIPredicate::sgt;
|
predType = arith::CmpIPredicate::sgt;
|
||||||
resultVal = rewriter.create<arith::MaxSIOp>(nestedLoc, newValue,
|
resultVal = rewriter.create<arith::MaxSIOp>(nestedLoc, newValue,
|
||||||
oldValue);
|
oldValue);
|
||||||
|
|
Loading…
Reference in New Issue