Skip to content

Commit a5a15f9

Browse files
format
Signed-off-by: Alexandre Eichenberger <[email protected]>
1 parent 8759c27 commit a5a15f9

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

src/Conversion/ONNXToKrnl/Math/Elementwise.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1482,8 +1482,8 @@ static LogicalResult getPartiallyFlattenedSimdCode(
14821482
}
14831483
}
14841484
}
1485-
create.krnl.iterateIE(
1486-
loopDef, loopDef, lbs, ubs, [&](const KrnlBuilder &ck, ValueRange loopInd) {
1485+
create.krnl.iterateIE(loopDef, loopDef, lbs, ubs,
1486+
[&](const KrnlBuilder &ck, ValueRange loopInd) {
14871487
MultiDialectBuilder<KrnlBuilder> create(ck);
14881488
// LoopInd has the current indices for all but the innermost dim. Since
14891489
// we expect here the entire innermost loop iteration in one go, the
@@ -1529,7 +1529,7 @@ static LogicalResult getPartiallyFlattenedSimdCode(
15291529

15301530
create.krnl.simdIterateIE(zero, SymIE(simdUb), VL, simdOnly,
15311531
useParallelInSimdLoop, inputs, inputAFs, {output}, {outputAF},
1532-
{[&](const KrnlBuilder &kb, ArrayRef<Value> inputVals, int64_t VL) {
1532+
{[&](const KrnlBuilder &kb, ArrayRef<Value> inputVals, int64_t VL) {
15331533
MultiDialectBuilder<MathBuilder> create(kb);
15341534
Type currElementType = outputElementType;
15351535
if (VL > 1)

src/Conversion/ONNXToKrnl/Math/Gemm.cpp

+8-4
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ struct ONNXGemmOpLowering : public OpConversionPattern<GemmOp> {
250250
}
251251
// Compute: A[i, k] * b[k, j] -> R[i, j])
252252
create.krnl.iterateIE({ii, jj, kk}, {ii1, jj1}, {zeroIE, zeroIE, zeroIE},
253-
{I, J, K}, [&](const KrnlBuilder &createKrnl, ValueRange i1_j1_indices) {
253+
{I, J, K},
254+
[&](const KrnlBuilder &createKrnl, ValueRange i1_j1_indices) {
254255
Value i1(i1_j1_indices[0]), j1(i1_j1_indices[1]);
255256
// If parallel, allocate on stack inside the parallel region.
256257
if (enableParallel) {
@@ -272,7 +273,8 @@ struct ONNXGemmOpLowering : public OpConversionPattern<GemmOp> {
272273
else
273274
createKrnl.copyToBuffer(bBuff, B, {k1, j1}, zeroVal, false);
274275
createKrnl.iterate({}, {jj2, ii2}, {}, {},
275-
[&](const KrnlBuilder &createKrnl, ValueRange j2_i2_indices) {
276+
[&](const KrnlBuilder &createKrnl,
277+
ValueRange j2_i2_indices) {
276278
Value j2(j2_i2_indices[0]), i2(j2_i2_indices[1]);
277279
ArrayRef<int64_t> empty;
278280
createKrnl.matmul(aBuff, {i1, k1}, bBuff, {k1, j1},
@@ -316,7 +318,8 @@ struct ONNXGemmOpLowering : public OpConversionPattern<GemmOp> {
316318
// "not currently used ones" like ii here last. Gave an error when ii was
317319
// listed first.
318320
create.krnl.iterateIE({jj, kk, ii}, {jj1, kk1}, {zeroIE, zeroIE, zeroIE},
319-
{J, K, I}, [&](const KrnlBuilder &createKrnl, ValueRange j1_k1_indices) {
321+
{J, K, I},
322+
[&](const KrnlBuilder &createKrnl, ValueRange j1_k1_indices) {
320323
Value j1(j1_k1_indices[0]), k1(j1_k1_indices[1]);
321324
// If parallel, allocate on stack inside the parallel region.
322325
if (enableParallel) {
@@ -337,7 +340,8 @@ struct ONNXGemmOpLowering : public OpConversionPattern<GemmOp> {
337340
else
338341
createKrnl.copyToBuffer(aBuff, A, {i1, k1}, zeroVal, false);
339342
createKrnl.iterate({}, {jj2, ii2}, {}, {},
340-
[&](const KrnlBuilder &createKrnl, ValueRange j2_i2_indices) {
343+
[&](const KrnlBuilder &createKrnl,
344+
ValueRange j2_i2_indices) {
341345
Value j2(j2_i2_indices[0]), i2(j2_i2_indices[1]);
342346
createKrnl.matmul(aBuff, {i1, k1}, bBuff, {k1, j1}, R,
343347
{z, z},

src/Conversion/ONNXToKrnl/Math/Softmax.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ static void emitInnerLoops(KrnlBuilder &createKrnl, int64_t numberOfLoops,
3333
// Compute the maximum value along axis.
3434
ValueRange maxLoops = createKrnl.defineLoops(numberOfLoops);
3535
auto maxLoop = createKrnl.iterateIE(maxLoops, maxLoops, Lbs, Ubs, maxInits,
36-
[&](const KrnlBuilder &createKrnl, ValueRange maxIndices, ValueRange iterArgs) {
36+
[&](const KrnlBuilder &createKrnl, ValueRange maxIndices,
37+
ValueRange iterArgs) {
3738
// Get last argument for the iterate body.
3839
Value iterArg = iterArgs.back();
3940

@@ -67,7 +68,8 @@ static void emitInnerLoops(KrnlBuilder &createKrnl, int64_t numberOfLoops,
6768
// Compute the sum of all values along axis.
6869
ValueRange sumLoops = createKrnl.defineLoops(numberOfLoops);
6970
auto sumLoop = createKrnl.iterateIE(sumLoops, sumLoops, Lbs, Ubs, sumInits,
70-
[&](const KrnlBuilder &createKrnl, ValueRange sumIndices, ValueRange iterArgs) {
71+
[&](const KrnlBuilder &createKrnl, ValueRange sumIndices,
72+
ValueRange iterArgs) {
7173
// Get last argument for the iterate body.
7274
Value iterArg = iterArgs.back();
7375

src/Conversion/ONNXToKrnl/Tensor/Resize.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ struct ONNXResizeOpLowering : public OpConversionPattern<ONNXResizeOp> {
121121
SmallVector<IndexExpr, 4> lbs(rank, LitIE(0));
122122
SmallVector<IndexExpr, 4> ubs;
123123
create.krnlIE.getShapeAsDims(alloc, ubs);
124-
create.krnl.iterateIE(
125-
loopDef, loopDef, lbs, ubs, [&](const KrnlBuilder &ck, ValueRange loopInd) {
124+
create.krnl.iterateIE(loopDef, loopDef, lbs, ubs,
125+
[&](const KrnlBuilder &ck, ValueRange loopInd) {
126126
MultiDialectBuilder<KrnlBuilder, IndexExprBuilderForKrnl, MathBuilder>
127127
create(ck);
128128
SmallVector<Value, 4> readIndices;

src/Dialect/Mlir/DialectBuilder.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -1697,9 +1697,8 @@ void MemRefBuilder::prefetchIE(Value memref, ArrayRef<IndexExpr> indices,
16971697
// Structured Control Flow (SCF).
16981698
//===----------------------------------------------------------------------===//
16991699

1700-
void SCFBuilder::ifThenElse(Value cond,
1701-
SCFThenElseBodyFn thenFn,
1702-
SCFThenElseBodyFn elseFn) const {
1700+
void SCFBuilder::ifThenElse(
1701+
Value cond, SCFThenElseBodyFn thenFn, SCFThenElseBodyFn elseFn) const {
17031702
if (!elseFn) {
17041703
b().create<scf::IfOp>(loc(), cond,
17051704
/* then */

0 commit comments

Comments
 (0)