Skip to main content

Module view

Module view 

Source
Expand description

One CPU-access window, for every backend.

Replaces the six per-backend *Map<T> types. They differed in how they obtained an address — mmap, IOSurfaceLock, glMapBufferRange, AHardwareBuffer_lock — but once obtained they all carried the same five things: a base pointer, the shape, an offset, an optional padded extent, and whether writes are allowed. HostPin already absorbs the first and third (its address is offset-adjusted, its keepalive releases whatever the backend acquired), which leaves this type holding the other three.

The acquisition difference does not need a type per backend, only a constructor per backend: persistent ones hand over a real pin, lock-scoped ones (PBO, AHardwareBuffer) hand over a pin whose keepalive unlocks on drop. Either way what the caller gets is the same window.

Structs§

HostView
A CPU-accessible window onto a tensor’s memory.