Skip to content

Commit 3ddbe3a

Browse files
authored
Use _disable_flatten_get_tile helper in tile_id (#200)
1 parent ac339d0 commit 3ddbe3a

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

helion/language/tile_ops.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,8 @@ def _(tile: torch.SymInt) -> torch.SymInt:
153153

154154
@_decorators.codegen(tile_id)
155155
def _(state: CodegenState) -> ast.AST:
156-
t = state.proxy_arg(0)
157-
env = CompileEnvironment.current()
158-
assert isinstance(t, torch.SymInt)
159-
index = env.get_block_id(t)
160-
assert index is not None
161-
# disable_flatten:
162-
# The functions in this file can't be used in flattened loops.
163-
env.config_spec.flatten_loops.disable_block_id(index)
156+
index = _disable_flatten_get_tile(state.proxy_arg(0))
164157
offset = state.codegen.offset_var(index)
165-
166158
block_size = state.device_function.block_size_var(index)
167159
if block_size is None:
168160
expr_str = offset

0 commit comments

Comments
 (0)