(ctx:AllocCtx, u:UOp)
| 16 | return x.replace(tag=(len(ctx.uop_list)-1,)) |
| 17 | |
| 18 | def disk_copy_is_buffer(ctx:AllocCtx, u:UOp): |
| 19 | # copies to disk are replaced with the disk buffer |
| 20 | to_disk = isinstance(u.device, str) and u.device.startswith(("DISK", "TINYFS")) |
| 21 | if to_disk: ctx.buffer_map[u] = u.empty_like() |
| 22 | # all copies from disk/numpy are realized into a real buffer |
| 23 | from_creation = isinstance(u.src[0].device, str) and any(u.src[0].device.startswith(x) for x in ["NPY", "DISK", "PYTHON", "TINYFS"]) |
| 24 | if from_creation: return tag_uop(ctx, u) |
| 25 | |
| 26 | def apply_after(ctx:AllocCtx, u:UOp): |
| 27 | base = u.src[0] |
nothing calls this directly
no test coverage detected
searching dependent graphs…