From c3333c6bb16e4ed623f42b9e139e4e0a2ee8bcd8 Mon Sep 17 00:00:00 2001 From: builder Date: Tue, 28 Jul 2026 20:30:04 +0000 Subject: [PATCH] Samples: Add DLPack CUDA sample and CSV output for ZividBenchmark New sample: - CaptureAndConvertToDlpackTensorOnCuda: capture a 2D+3D frame and build DLPack tensors directly from the Zivid DeviceArrays on the CUDA device, for both the point cloud (PointXYZ) and the color image (ColorRGBA_SRGB). It builds a DLManagedTensor from the device pointer, shape, strides in elements, element data type and CUDA device, and validates the result. A consumer such as PyTorch, CuPy or JAX can then import the tensor for zero-copy GPU processing. The DeviceArray is kept alive for as long as the consumer holds the tensor. - The sample is off by default. Build it with -DUSE_DLPACK=ON alongside -DUSE_CUDA=ON, and point DLPACK_INCLUDE_DIR at the directory containing dlpack/dlpack.h. ZividBenchmark: - A run now also writes its results to a CSV file, so results can be archived and compared across machines or cameras. Each row carries a timestamp, test category, test name, iteration, median and mean time in milliseconds, the settings used, and the camera model and serial number. API version, OS and compute device are recorded too. - The file is named zivid_benchmark_results__