Click or drag to resize

ComputeDeviceCreateDeviceArrayViewColorRGBAf Method (CUDADevicePointer, UInt64, UInt64, CUDAStreamPtr)

Create a non-owning DeviceArrayView of ColorRGBAf over an externally-owned CUDA device pointer

Namespace:  Zivid.NET
Assembly:  ZividCoreNET (in ZividCoreNET.dll) Version: 2.18.0.0
Syntax
public DeviceArrayView<ColorRGBAf> CreateDeviceArrayViewColorRGBAf(
	CUDADevicePointer cudaPointer,
	ulong width,
	ulong height,
	CUDAStreamPtr stream
)

Parameters

cudaPointer
Type: Zivid.NETCUDADevicePointer
Non-null CUDA device pointer to RGBA float32 data
width
Type: SystemUInt64
Width of the image in pixels
height
Type: SystemUInt64
Height of the image in pixels
stream
Type: Zivid.NETCUDAStreamPtr
The CUDA stream the buffer's preparation work (allocation and any data production) was enqueued on

Return Value

Type: DeviceArrayViewColorRGBAf
A non-owning DeviceArrayViewNETFormat of ColorRGBAf referencing the provided CUDA memory
Remarks
The device pointer must be created using the same CUDA context used by the Zivid SDK. The memory must contain tightly packed (interleaved) RGBA float32 pixel data. The returned DeviceArrayView does not take ownership of the CUDA memory; the caller must keep the pointer valid for the lifetime of the view and any copies of it. The stream exists solely so the SDK does not use the buffer before it is ready: an event is recorded on it and the SDK's internal compute stream waits on it. The stream is not stored on the view. When the view is later passed to a fill variant, that method takes its own StreamOrQueue; it need not be the same stream. Only available when the compute backend is CUDA. Throws if called with an OpenCL backend.
See Also