Interface IDeviceMemoryManager
- Namespace
- NVMathNet.Memory
- Assembly
- NVMath.Net.dll
Allocates and frees GPU device memory for NVMathNet.DeviceBuffer`1. Implement this to plug in a pooling or externally managed allocator. Implementations must be thread-safe.
public interface IDeviceMemoryManagerMethods
Allocate(nuint)
Allocates sizeInBytes bytes of device memory.
nint Allocate(nuint sizeInBytes)Parameters
sizeInBytesnuint-
Requested size; always greater than zero.
Returns
- nint
-
A device pointer that stays valid until passed to NVMathNet.Memory.IDeviceMemoryManager.Free(System.IntPtr).
Free(nint)
Releases memory previously returned by NVMathNet.Memory.IDeviceMemoryManager.Allocate(System.UIntPtr) on this manager. A pooling manager may hand the block out again immediately, so callers must make sure no queued GPU work still uses it (synchronise the stream first).
void Free(nint pointer)Parameters
pointernint-
The device pointer to release.