MCPcopy Create free account
hub / github.com/tinygrad/tinygrad / alloc_cbuffer

Function alloc_cbuffer

tinygrad/runtime/support/usb.py:8–8  ·  view source on GitHub ↗
(sz:int)

Source from the content-addressed store, hash-verified

6from tinygrad.runtime.support import c
7
8def alloc_cbuffer(sz:int) -> tuple[ctypes.Array, memoryview]: return (buf:=(ctypes.c_ubyte * sz)()), to_mv(ctypes.addressof(buf), sz)
9def checked(fn, msg=None):
10 @functools.wraps(fn)
11 def wrapper(*args):

Callers 4

__init__Method · 0.85
_bulk_outMethod · 0.85
_bulk_inMethod · 0.85
__init__Method · 0.85

Calls 1

to_mvFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…