MCPcopy
hub / github.com/tinygrad/tinygrad / alloc_sysmem

Method alloc_sysmem

tinygrad/runtime/support/system.py:230–231  ·  view source on GitHub ↗
(self, size:int, vaddr:int=0, contiguous:bool=False)

Source from the content-addressed store, hash-verified

228
229 def dma_view(self, ctrl_addr, size): return USBMMIOInterface(self.usb, ctrl_addr, size, fmt='B', pcimem=False)
230 def alloc_sysmem(self, size:int, vaddr:int=0, contiguous:bool=False) -> tuple[MMIOInterface, list[int]]:
231 return self.dma_view(0xf000 + (off:=self.sram.alloc(size)), size), [0x200000 + off]
232
233 def read_config(self, offset:int, size:int): return self.usb.pcie_cfg_req(offset, bus=4, dev=0, fn=0, size=size)
234 def write_config(self, offset:int, value:int, size:int): self.usb.pcie_cfg_req(offset, bus=4, dev=0, fn=0, value=value, size=size)

Callers

nothing calls this directly

Calls 2

dma_viewMethod · 0.95
allocMethod · 0.45

Tested by

no test coverage detected