⚡ Super Fast Ambiguity Library (Version 3.0) 🚀 This Dynamic Link Library (DLL) provides extremely fast computation of Ambiguity Maps using NVIDIA CUDA GPU acceleration, leveraging advanced signal processing techniques and low-level optimizations.
The library's exported functions (e.g., Initialize, Run, Release) are designed without being wrapped in a class for maximum clarity and ease of integration.
🌟 Key Features and Performance Optimizations Version 3.0 represents a significant leap in performance, achieving a processing speed over 100% faster compared to the initial fast version of the code from two years ago.
NVIDIA CUDA Acceleration: The core signal processing pipeline (FFT, correlation, IFFT, magnitude calculation) is executed entirely on the NVIDIA GPU, utilizing the cuFFT library and custom CUDA kernels.
Low-Level Optimizations:
FMA and __ldg: CUDA kernels, such as complex_conj_mult_opt and ConvertAndScaleCUDA, utilize Fused Multiply-Add (FMA) instructions and the __ldg (Read-Only Data Cache) intrinsic to maximize computational efficiency and memory access performance.
Precomputed Tables (PRECOMPUTE): Constant memory on the GPU is used to store pre-calculated Doppler Shift Offsets, eliminating complex calculations within the hot loop of the CorelateShiftCUDA kernel and significantly increasing speed.
Host-Side Parallelism: Post-processing tasks (normalization, scaling, symmetry removal) are accelerated using OpenMP on the host CPU.
cuFFT Integration: The project relies on the included cuFFT components from the CUDA Toolkit for highly optimized Fast Fourier Transforms.
🛠️ System Requirements To compile and run this project, you will need:
NVIDIA GPU: A graphics card that supports the CUDA platform.
Microsoft Visual Studio 2022.
NVIDIA CUDA Toolkit (Recommended: v12.0 or newer).
- Installing the CUDA Toolkit (Recommended v12.x/13.x) Download and install the latest stable version of the CUDA Toolkit directly from the NVIDIA website.
Download Page: https://developer.nvidia.com/cuda-downloads
Installation: Follow the installer instructions. Crucially, ensure that the option for Visual Studio 2022 integration is selected during the installation process.
- Configuring Visual Studio 2022 After installing the CUDA Toolkit, you must configure your Visual Studio project to correctly compile .cu files and link against the necessary CUDA libraries.
Create or Open the Project: Open your DLL project in VS2022.
Project Properties:
Right-click on the project name in the Solution Explorer and select Properties.
Navigate to Configuration Properties -> CUDA C/C++ -> General.
Verify the Target Platform Version is set to the version you installed (e.g., CUDA 12.4).
Linker Settings:
Go to Linker -> Input.
In the Additional Dependencies field, add the following required libraries:
cuda.lib cudart.lib cufft.lib File Type Configuration (if needed): Ensure the .cu file is recognized as a CUDA source file.
In Solution Explorer, right-click on Ambiguity.cu.
Select Properties.
Go to General.
Set the Item Type to CUDA C/C++.
🧠 Pinned Memory (Optional) The header file Ambiguity.h defines the PINED macro, enabling the use of page-locked host memory via the functions AllocHostMemory and FreeHostMemory. This technique is typically used for faster, asynchronous CPU-to-GPU data transfers (DMA).
Recommendation: While available, the use of Pinned Memory is not recommended for general applications, especially when interfacing with the DLL from languages like C#, as it often does not provide a noticeable speed increase in that context and adds complexity to memory management.
🧪 Testing To test the full functionality of this library, please refer to the dedicated test repository:
Test Repository: ambiguity_test (Please check the repository's sister project for the latest testing application.)