You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding skeleton AMDGPU buffer handle and handle pool. (iree-org#21044)
The driver will implement two buffer types to start (or more?):
`iree_hal_amdgpu_external_buffer_t` and
`iree_hal_amdgpu_transient_buffer_t`. The external buffer will be used
for imported buffers and synchronous allocations (probably), while the
transient buffer is used for all asynchronous allocations. The transient
buffer maintains a reference to a device-accessible
`iree_hal_amdgpu_device_allocation_handle_t` that stores the allocated
pointer. The device-side allocator will update the handle as it
allocates/deallocates and anyone resolving buffer pointers (e.g.
`iree_hal_amdgpu_device_buffer_ref_resolve`) fetches the current pointer
from the handle. The pointer is only valid between alloca/dealloca ops
(which will set/reset the pointer).
`iree_hal_amdgpu_device_buffer_ref_t` is a variant that allows binding
tables and command buffer ops to reference typed buffers. Most code can
dereference device pointers (synchronously allocated buffers, imported
buffers, etc) and the transient buffer handles. Command buffers can
reference binding table slots with a relative offset/length.
`iree_hal_amdgpu_device_workgroup_count_buffer_ref_t` is a special case
for indirect dispatches (where the length is always known) as it packs
better into space-constrained structs.
A simple `iree_hal_amdgpu_buffer_pool_t` handles both the host
`iree_hal_buffer_t` instances and device allocation handles. The device
allocation handles can be stored in device memory to avoid additional
bus traffic on each dereference. In the steady state of invocations with
alloca/dealloca the pool should remove all host/device allocations.
0 commit comments