Zivid C++ API 2.18.0+1b44dbef-1
Zivid::StreamOrQueue Struct Reference

A user CUDA stream or OpenCL command queue, selected by which member is populated. More...

#include <Zivid/ComputeWrappers.h>

Public Member Functions

 StreamOrQueue (CUDAStreamPtr s)
 StreamOrQueue (OpenCLCommandQueuePtr q)

Public Attributes

CUDAStreamPtr stream
OpenCLCommandQueuePtr commandQueue

Detailed Description

A user CUDA stream or OpenCL command queue, selected by which member is populated.

Used by SDK acquisition methods (e.g. Frame2D::imageDeviceArray, PointCloud::devicePointsXYZ) so that callers pass either a CUDAStreamPtr or an OpenCLCommandQueuePtr through a single method signature. Both wrapper types convert implicitly to StreamOrQueue. The active backend (set at SDK build time) picks the corresponding member; the other must be left null or the call throws:

  • CUDA build: reads stream.stream as the destination CUDA stream (nullptr is allowed and means CUDA's default/legacy stream); commandQueue.commandQueue must be null.
  • OpenCL build: reads commandQueue.commandQueue as the destination OpenCL queue (must be non-null); stream.stream must be null. A default-constructed StreamOrQueue (both members null) is therefore valid only against a CUDA build, where it means "sync to the CUDA default stream".

Constructor & Destructor Documentation

◆ StreamOrQueue() [1/2]

Zivid::StreamOrQueue::StreamOrQueue ( CUDAStreamPtr s)
inline

◆ StreamOrQueue() [2/2]

Zivid::StreamOrQueue::StreamOrQueue ( OpenCLCommandQueuePtr q)
inline

Member Data Documentation

◆ commandQueue

OpenCLCommandQueuePtr Zivid::StreamOrQueue::commandQueue

◆ stream

CUDAStreamPtr Zivid::StreamOrQueue::stream

The documentation for this struct was generated from the following file: