ProgramSpec uops must end with SINK [pr] (#12981)

This commit is contained in:
chenyu
2025-10-28 17:12:22 -04:00
committed by GitHub
parent 9442442cb1
commit f55fcfecf9

View File

@@ -105,8 +105,10 @@ class ProgramSpec:
def function_name(self) -> str: return to_function_name(self.name)
@property
def applied_opts(self) -> tuple[Opt, ...]|None: return self.uops[-1].arg.applied_opts if \
self.uops is not None and self.uops[-1].op is Ops.SINK and self.uops[-1].arg is not None else None
def applied_opts(self) -> tuple[Opt, ...]|None:
if self.uops is None: return None
assert self.uops[-1].op is Ops.SINK, self.uops[-1].op
return self.uops[-1].arg.applied_opts
def launch_dims(self, var_vals:dict[str, int]):
global_size = [sym_infer(sz, var_vals) for sz in self.global_size] if self.global_size is not None else None