MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / alloc_vaddr

Method alloc_vaddr

tinygrad/runtime/support/memory.py:230–232  ·  view source on GitHub ↗
(cls, size:int, align=0x1000)

Source from the content-addressed store, hash-verified

228
229 @classmethod
230 def alloc_vaddr(cls, size:int, align=0x1000) -> int:
231 assert cls.va_allocator is not None, "must be set"
232 return cls.va_allocator.alloc(size, max((1 << (size.bit_length() - 1)), align))
233
234 @functools.cache # pylint: disable=method-cache-max-size-none
235 def identity_va(self, uncached:bool) -> int:

Callers 7

identity_vaMethod · 0.95
vallocMethod · 0.95
_dma_regionMethod · 0.80
allocMethod · 0.80
init_swMethod · 0.80
init_golden_imageMethod · 0.80
map_phys_to_gpuFunction · 0.80

Calls 1

allocMethod · 0.45

Tested by

no test coverage detected