$ show alicevision/popsift
PopSift is a CUDA-accelerated SIFT (Scale-Invariant Feature Transform) feature extraction library. It provides a C++ library (libpopsift) with an asynchronous API for enqueuing images and retrieving features, and two command-line demo applications (popsift-demo, popsift-match). The library implements the full SIFT pipeline (Gaussian pyramid, extrema detection, orientation assignment, descriptor computation) on NVIDIA GPUs, supporting multiple algorithmic variants (PopSift, VLFeat, OpenCV) for research comparison. It is designed for high-performance real-time feature extraction and can be integrated via CMake. Despite its research origins (Simula Research Laboratory), the codebase is well-structured with modular CUDA kernels, debug utilities, and parallel primitives. The library is actively used in computer vision projects and maintains compatibility with recent CUDA versions while preserving legacy fallbacks.
The LLM identified 3 files worth highlighting for reuse:
Implements an exclusive block-level prefix sum for CUDA warps/thread blocks. Uses a two-phase algorithm (intra-warp scan + inter-warp coordination) suitable for large arrays. Encapsulated as a template function that can be extracted into any CUDA project requiring efficient prefix sums without Thrust.
Provides a warp-level bitonic sort implementation for small arrays (up to 32 elements) within a single warp. Uses warp shuffle instructions (__shfl_sync) for high performance. Reusable in any CUDA project that needs fast sorting of small batches, e.g., in filtering or reduction stages.
A thread-safe, bounded queue template for passing jobs between producer and consumer threads. Uses std::mutex and std::condition_variable to block on empty/full conditions. Minimal dependencies (only standard library) and can be reused directly in any multi-threaded C++ project for work scheduling.