When trying to define the following MLIR Op
def Test_op: My_OP<"Test_Op", [AttrSizedOperandSegments]> {
let arguments = (ins
Optional<I1>:$op1,
VariadicOfVariadic<AnyType, "op_size">:$op2,
DenseI32ArrayAttr:$op_size
);
let assemblyFormat = [{
$op1 `:` type($op1)
$op2 `:` type($op2) attr-dict
}];
}
I am getting these build errors:
In file included from ~/llvm-project/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp:1146:
tools/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.cpp.inc:10300:146: error: no member named 'accumulate' in namespace 'std'
odsState.addAttribute(getOperandSegmentSizesAttrName(odsState.name), odsBuilder.getDenseI32ArrayAttr({(op1 ? 1 : 0), static_cast<int32_t>(std::accumulate(op2.begin(), op2.end(), 0, [](int32_t curSum, ::mlir::ValueRange range) { return curSum + range.size(); }))}));
~~~~~^
tools/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.cpp.inc:10313:146: error: no member named 'accumulate' in namespace 'std'
odsState.addAttribute(getOperandSegmentSizesAttrName(odsState.name), odsBuilder.getDenseI32ArrayAttr({(op1 ? 1 : 0), static_cast<int32_t>(std::accumulate(op2.begin(), op2.end(), 0, [](int32_t curSum, ::mlir::ValueRange range) { return curSum + range.size(); }))}));
However changing AttrSizedOperandSegments
to SameVariadicOperandSize
the error goes away.
Any help is appreciated.
Cheers