From 0735224ac2d996dbec77d8aeefeb666746155f8d Mon Sep 17 00:00:00 2001 From: simone-pietro <70058364+simone-pietro@users.noreply.github.com> Date: Wed, 18 Jun 2025 14:39:27 +0200 Subject: [PATCH] Pass PythonRenderer instance to full_rewrite (#10859) --- test/helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/helpers.py b/test/helpers.py index 6c42553448..e8eeea9bf8 100644 --- a/test/helpers.py +++ b/test/helpers.py @@ -59,8 +59,9 @@ def eval_uop(uop:UOp, inputs:list[tuple[DType, list[Any]]]|None=None): bufs.append(buf:=allocator.alloc(len(data) * buf_dt.itemsize)) allocator._copyin(buf, memoryview(struct.pack(str(len(data)) + buf_dt.fmt, *data))) g = UOp(Ops.DEFINE_GLOBAL, uop.dtype.ptr(), arg=0, src=()) - lst = full_rewrite(UOp.store(g.index(UOp.const(dtypes.int, 0)), uop).sink(), PythonRenderer) - prog = PythonProgram("run", PythonCompiler().compile(PythonRenderer().render(lst))) + opts = PythonRenderer() + lst = full_rewrite(UOp.store(g.index(UOp.const(dtypes.int, 0)), uop).sink(), opts) + prog = PythonProgram("run", PythonCompiler().compile(opts.render(lst))) prog(out_buf:=allocator.alloc(uop.dtype.itemsize), *bufs) return out_buf.cast(uop.dtype.fmt).tolist()[0]