MCPcopy
hub / github.com/tinygrad/tinygrad / exec_view

Function exec_view

tinygrad/engine/realize.py:149–154  ·  view source on GitHub ↗
(ctx:ExecContext, call:UOp, ast:UOp)

Source from the content-addressed store, hash-verified

147 for j, per_dev in enumerate(zip(*[cast(MultiBuffer, b).bufs for b in bufs])): yield list(per_dev), {dnum: j} if dnum else {}
148
149def exec_view(ctx:ExecContext, call:UOp, ast:UOp) -> float|None:
150 resolved = resolve_params(call, ctx.input_uops)
151 bufs = [cast(Buffer, b.buffer) for b in resolved]
152 bv = bufs[1].view(resolved[0].arg, ast.dtype, ast.arg[1]*bufs[1].dtype.itemsize)
153 with track_stats(ctx, call, bv.device, [bv, bufs[1]], ctx.var_vals): buffers[resolved[0]] = bv
154 return None
155
156def exec_copy(ctx:ExecContext, call:UOp, ast:UOp) -> float|None:
157 for bufs, device_vars in unwrap_multi(call, resolve_params(call, ctx.input_uops)):

Callers

nothing calls this directly

Calls 4

resolve_paramsFunction · 0.85
castFunction · 0.85
track_statsFunction · 0.85
viewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…