Class BaseUnifiedBuffer<T>
- Namespace
- DotCompute.Memory
- Assembly
- DotCompute.Memory.dll
Base class for unified memory buffers (accessible from both CPU and GPU).
public abstract class BaseUnifiedBuffer<T> : BaseMemoryBuffer<T>, IUnifiedMemoryBuffer<T>, IUnifiedMemoryBuffer, IAsyncDisposable, IDisposable where T : unmanaged
Type Parameters
T
- Inheritance
-
BaseUnifiedBuffer<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
BaseUnifiedBuffer(long, nint)
Initializes a new instance of the BaseUnifiedBuffer<T> class.
protected BaseUnifiedBuffer(long sizeInBytes, nint unifiedPointer)
Parameters
Properties
DevicePointer
public override nint DevicePointer { get; }
Property Value
IsDisposed
Gets whether the buffer has been disposed.
public override bool IsDisposed { get; }
Property Value
MemoryType
public override MemoryType MemoryType { get; }
Property Value
Methods
AsSpan()
Gets a span view of the unified memory for CPU access.
public override Span<T> AsSpan()
Returns
- Span<T>
MarkDisposed()
Marks the buffer as disposed.
protected bool MarkDisposed()