Enum GpuBridgeDirection
- Namespace
- DotCompute.Backends.CUDA.RingKernels
- Assembly
- DotCompute.Backends.CUDA.dll
Direction of data transfer for a GPU ring buffer bridge.
public enum GpuBridgeDirection
Fields
Bidirectional = 2Both directions (for debugging/testing only).
DeviceToHost = 1GPU → Host: GPU writes to GPU buffer (output bridges). The GPU kernel advances the GPU tail pointer after writing messages. The bridge is the consumer and advances the head pointer.
HostToDevice = 0Host → GPU: Host writes to GPU buffer (input bridges). The bridge advances the GPU tail pointer after writing messages. The GPU kernel is the consumer and advances the head pointer.
Remarks
This determines which DMA transfer loop runs:
- HostToDevice: Input bridges - host writes messages, GPU kernel reads
- DeviceToHost: Output bridges - GPU kernel writes messages, host reads
- Bidirectional: Both directions (for debugging, not recommended for production)
Critical: Using wrong direction causes race conditions where the bridge consumes messages before the kernel can process them.