Skip to content

Commit 4ca528b

Browse files
Format and update filecheck checks
1 parent 0d00bd9 commit 4ca528b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

mlir/python/mlir/dialects/gpu/__init__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ def __init__(
8787

8888
if known_block_size is not None:
8989
if isinstance(known_block_size, Sequence):
90-
self.attributes[self.KNOWN_BLOCK_SIZE_ATTR_NAME] = (
91-
DenseI32ArrayAttr.get(known_block_size)
92-
)
90+
block_size = DenseI32ArrayAttr.get(known_block_size)
91+
self.attributes[self.KNOWN_BLOCK_SIZE_ATTR_NAME] = block_size
9392
elif isinstance(known_block_size, DenseI32ArrayAttr):
9493
self.attributes[self.KNOWN_BLOCK_SIZE_ATTR_NAME] = known_block_size
9594
else:
@@ -99,9 +98,8 @@ def __init__(
9998

10099
if known_grid_size is not None:
101100
if isinstance(known_grid_size, Sequence):
102-
self.attributes[self.KNOWN_GRID_SIZE_ATTR_NAME] = DenseI32ArrayAttr.get(
103-
known_grid_size
104-
)
101+
grid_size = DenseI32ArrayAttr.get(known_grid_size)
102+
self.attributes[self.KNOWN_GRID_SIZE_ATTR_NAME] = grid_size
105103
elif isinstance(known_grid_size, DenseI32ArrayAttr):
106104
self.attributes[self.KNOWN_GRID_SIZE_ATTR_NAME] = known_grid_size
107105
else:

mlir/test/python/dialects/gpu/dialect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ def builder(func: gpu.GPUFuncOp) -> None:
148148
# CHECK: gpu.return
149149
# CHECK: }
150150
# CHECK: gpu.func @kernel1() kernel attributes
151-
# CHECK-SAME: gpu.known_block_size = array<i32: 1, 2, 3>
152-
# CHECK-SAME: gpu.known_grid_size = array<i32: 4, 5, 6>
151+
# CHECK-SAME: known_block_size = array<i32: 1, 2, 3>
152+
# CHECK-SAME: known_grid_size = array<i32: 4, 5, 6>
153153
# CHECK: %[[VAL_0:.*]] = gpu.global_id x
154154
# CHECK: gpu.return
155155
# CHECK: }

0 commit comments

Comments
 (0)