Table of Contents

Class CudaMallocMemoryManager

Namespace
NVMathNet.Memory
Assembly
NVMath.Net.dll

The default manager: plain cudaMalloc / cudaFree.

public sealed class CudaMallocMemoryManager : IDeviceMemoryManager

Inheritance

Implements

Inherited Members

Properties

Instance

The shared instance.

public static CudaMallocMemoryManager Instance { get; }

Property Value

CudaMallocMemoryManager

Methods

Allocate(nuint)

Allocates sizeInBytes bytes of device memory.

public nint Allocate(nuint sizeInBytes)

Parameters

sizeInBytes nuint

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

pointer nint

The device pointer to release.