Table of Contents

Class CudaComputeBuffer<T>

Namespace
Orleans.GpuBridge.Runtime
Assembly
Orleans.GpuBridge.Runtime.dll

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

size int

Number of elements in the buffer

usage BufferUsage

Usage flags for the buffer

logger ILogger

Logger instance for diagnostics

Properties

Size

Gets the size of the buffer in elements

public int Size { get; }

Property Value

int

Usage

Gets the usage flags for the buffer

public BufferUsage Usage { get; }

Property Value

BufferUsage

Methods

CopyTo(IComputeBuffer<T>)

Copies the buffer contents to another buffer

public void CopyTo(IComputeBuffer<T> destination)

Parameters

destination IComputeBuffer<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

data Span<T>

Span to read data into

Write(ReadOnlySpan<T>)

Writes data to the buffer

public void Write(ReadOnlySpan<T> data)

Parameters

data ReadOnlySpan<T>

Data to write