Skip to content

Commit 0d00bd9

Browse files
Format
1 parent 91dd9b5 commit 0d00bd9

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ def __init__(
8080
elif isinstance(sym_name, StringAttr):
8181
self.attributes[self.SYM_NAME_ATTR_NAME] = sym_name
8282
else:
83-
raise ValueError(
84-
"sym_name must be a string or a StringAttr"
85-
)
83+
raise ValueError("sym_name must be a string or a StringAttr")
8684

8785
if kernel:
8886
self.attributes[self.KERNEL_ATTR_NAME] = UnitAttr.get()
@@ -137,8 +135,8 @@ def add_entry_block(self) -> Block:
137135
def entry_block(self) -> Block:
138136
if len(self.body.blocks) == 0:
139137
raise RuntimeError(
140-
f"Entry block does not exist for {self.name.value}." +
141-
" Do you need to call the add_entry_block() method on this GPUFuncOp?"
138+
f"Entry block does not exist for {self.name.value}."
139+
+ " Do you need to call the add_entry_block() method on this GPUFuncOp?"
142140
)
143141
return self.body.blocks[0]
144142

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ def builder(func: gpu.GPUFuncOp) -> None:
9393
func.entry_block
9494
assert False, "Expected RuntimeError"
9595
except RuntimeError as e:
96-
assert str(e) == "Entry block does not exist for kernel0. Do you need to call the add_entry_block() method on this GPUFuncOp?"
96+
assert (
97+
str(e)
98+
== "Entry block does not exist for kernel0. Do you need to call the add_entry_block() method on this GPUFuncOp?"
99+
)
97100

98101
block = func.add_entry_block()
99102
with InsertionPoint(block):

0 commit comments

Comments
 (0)