rocm.hipfile.buffer#
2026-09-24
4 min read time
Applies to Linux and Windows
Advanced Micro Devices, Inc.
Classes#
Lifecycle manager for a hipFile-registered GPU memory region. |
Module Contents#
- class rocm.hipfile.buffer.Buffer(buffer_ptr, length, flags)#
Lifecycle manager for a hipFile-registered GPU memory region.
The caller pre-allocates the underlying device buffer (typically via
hipMallocor any equivalent GPU-allocator) and constructs aBufferto register it with the hipFile driver. Deregistration happens on context exit (or via explicitderegister).Use as a context manager:
- with Buffer(ptr, length, flags=0) as registered_buf:
…
- classmethod from_ctypes_void_p(ctypes_void_p: ctypes.c_void_p, length, flags)#
Construct a
Bufferfrom actypes.c_void_p.
- property ptr#
- deregister()#
- register()#