MCPcopy
hub / github.com/tinygrad/tinygrad / bind

Method bind

tinygrad/runtime/ops_nv.py:105–112  ·  view source on GitHub ↗
(self, dev:NVDevice)

Source from the content-addressed store, hash-verified

103 def timestamp(self, signal:HCQSignal): return self.signal(signal, 0)
104
105 def bind(self, dev:NVDevice):
106 self.binded_device = dev
107 self.hw_page = dev.allocator.alloc(len(self._q) * 4, BufferSpec(cpu_access=True, nolru=True))
108 hw_view = self.hw_page.cpu_view().view(fmt='I')
109 for i, value in enumerate(self._q): hw_view[i] = value
110
111 # From now on, the queue is on the device for faster submission.
112 self._q = hw_view
113
114 def _submit_to_gpfifo(self, dev:NVDevice, gpfifo:GPFifo):
115 if dev == self.binded_device: cmdq_addr = self.hw_page.va_addr

Callers

nothing calls this directly

Calls 4

BufferSpecClass · 0.90
allocMethod · 0.45
viewMethod · 0.45
cpu_viewMethod · 0.45

Tested by

no test coverage detected