Class CudaMallocMemoryManager
- Namespace
- NVMathNet.Memory
- Assembly
- NVMath.Net.dll
The default manager: plain cudaMalloc / cudaFree.
public sealed class CudaMallocMemoryManager : IDeviceMemoryManagerInheritance
Implements
Inherited Members
Properties
Instance
The shared instance.
public static CudaMallocMemoryManager Instance { get; }Property Value
Methods
Allocate(nuint)
Allocates sizeInBytes bytes of device memory.
public 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).
public void Free(nint pointer)Parameters
pointernint-
The device pointer to release.