This commit is contained in:
2025-08-28 10:46:18 -07:00
parent 6e41040e91
commit d3aa38ad4a
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -32,6 +32,7 @@ def get_optimized_ast(ctx:Renderer, ast:UOp) -> UOp:
rawbufs = bufs_from_lin(kb, allocate=False)
k = beam_search(kb, rawbufs, BEAM.value, bool(getenv("BEAM_ESTIMATE", 1)))
new_arg = KernelInfo(opts_to_apply=tuple(k.applied_opts))
elif len(new_arg.applied_opts): return None
return Kernel(ast.replace(arg=None), opts=ctx).get_optimized_ast().replace(arg=new_arg)
pm_get_optimization = PatternMatcher([
+3
View File
@@ -41,6 +41,9 @@ class RKernel(Kernel):
# must be done earlier
def simplify_merge_adjacent(self): return
def apply_opt(self, opt:Opt, append_opt:bool=True) -> int|None:
return super().apply_opt(opt, append_opt)
def shift_to(self, axis:int, amount:int, new_type:AxisType, top:bool=False, insert_at:int|None=None):
old_sz = self.rng[axis].src[0].arg // amount
assert old_sz > 0, f"bad old_sz on {axis} {amount} {self.rng[axis]}"