Description
Implement Host-Only Memory Manager like in CUDA:
Some external memory managers will support management of on-device memory but not host memory. For implementing EMM Plugins using one of these memory managers, a partial implementation of a plugin that implements host-side allocation and pinning is provided. To use it, derive from HostOnlyCUDAMemoryManager instead of BaseCUDAMemoryManager. Guidelines for using this class are:
The host-only memory manager implements memhostalloc and mempin - the EMM Plugin should still implement memalloc.
If reset is overridden, it must also call super().reset() to allow the host allocations to be cleaned up.
If defer_cleanup is overridden, it must hold an active context manager from super().defer_cleanup() to ensure that host-side cleanup is also deferred.