Class CudaComputeBuffer<T>
CUDA compute buffer implementation
public sealed class CudaComputeBuffer<T> : IComputeBuffer<T>, IDisposable where T : unmanaged
Type Parameters
T
- Inheritance
-
CudaComputeBuffer<T>
- Implements
- Inherited Members
Constructors
CudaComputeBuffer(int, BufferUsage, ILogger)
Initializes a new instance of the CudaComputeBuffer<T> class
public CudaComputeBuffer(int size, BufferUsage usage, ILogger logger)
Parameters
sizeintNumber of elements in the buffer
usageBufferUsageUsage flags for the buffer
loggerILoggerLogger instance for diagnostics
Properties
Size
Gets the size of the buffer in elements
public int Size { get; }
Property Value
Usage
Gets the usage flags for the buffer
public BufferUsage Usage { get; }
Property Value
Methods
CopyTo(IComputeBuffer<T>)
Copies the buffer contents to another buffer
public void CopyTo(IComputeBuffer<T> destination)
Parameters
destinationIComputeBuffer<T>Destination buffer
Dispose()
Disposes the buffer
public void Dispose()
Read(Span<T>)
Reads data from the buffer
public void Read(Span<T> data)
Parameters
dataSpan<T>Span to read data into
Write(ReadOnlySpan<T>)
Writes data to the buffer
public void Write(ReadOnlySpan<T> data)
Parameters
dataReadOnlySpan<T>Data to write