Table of Contents

Namespace NVMathNet

Namespaces

NVMathNet.Fft
NVMathNet.Interop
NVMathNet.LinAlg
NVMathNet.Memory
NVMathNet.Rand
NVMathNet.Solver
NVMathNet.Sparse
NVMathNet.Tensor

Classes

CudaDevice

Represents a CUDA device and exposes device-level operations.

CudaEvent

Wraps a CUDA event handle. Supports async waiting via NVMathNet.CudaEvent.SynchronizeAsync(System.Threading.CancellationToken).

CudaStream

Wraps a CUDA stream handle and provides async-friendly synchronization. Owns the stream handle; call NVMathNet.CudaStream.DisposeAsync (or use await using) to destroy it.

DeviceBuffer<T>

A strongly-typed buffer of T residing in GPU device memory. Supports zero-copy async transfers with host-pinned memory. Implements System.IDisposable - dispose to free the device allocation.

MultiGpuContext

Manages a set of CUDA devices for single-process multi-GPU execution. Enables peer-to-peer access between GPUs and provides helpers to run work concurrently across devices using one thread per GPU.

NVMathLog

Dependency-free logging hook. By default nothing is logged. Install a NVMathNet.NVMathLog.Handler to receive messages and bridge them to a logging framework, for example:

NVMathLog.MinimumLevel = NVMathLogLevel.Information;
NVMathLog.Handler = (level, category, message) =>
    logger.Log(level switch { NVMathLogLevel.Error => LogLevel.Error, NVMathLogLevel.Warning => LogLevel.Warning,
                              NVMathLogLevel.Information => LogLevel.Information, _ => LogLevel.Debug },
               "{Category}: {Message}", category, message);

The handler is invoked synchronously on the thread that produced the event, possibly from several threads at once, so it must be thread-safe and fast. Exceptions thrown by the handler are swallowed.

PinnedBuffer<T>

Page-locked (pinned) host memory for maximum-throughput, zero-copy transfers between host and device.

Enums

NVMathLogLevel

Severity of a log message emitted through NVMathNet.NVMathLog.