Skip to content

perf: use SIMD-accelerated tcog_window_fast in refined centroiding path - #81

Merged
purvanshjoshi merged 9 commits into
mainfrom
ci/cuda-build-test-22
Jul 8, 2026
Merged

perf: use SIMD-accelerated tcog_window_fast in refined centroiding path#81
purvanshjoshi merged 9 commits into
mainfrom
ci/cuda-build-test-22

Conversation

@purvanshjoshi

Copy link
Copy Markdown
Contributor

Closes #22

- Uncomment test_cuda in CMakeLists.txt (mark .c source as CUDA language so
  nvcc compiles it).  The test requires a GPU to actually run but compiles
  on any runner with the CUDA toolkit installed.
- test_cuda.c: gracefully skip if no GPU available (rippra_cuda_centroid_init
  fails), prints SKIP and returns 0 instead of erroring.
- Add synthetic data generation and ctest run to CUDA CI job with
  continue-on-error: true — compiles on every push, runs only on GPU runners.
- CUDA README badge already exists.
nvcc treats .c files as C++ where goto cannot bypass variable initialization.
Moved all declarations to the top of main() and removed the skip: label in
favor of a skip flag.
- nvcc treats .c files as C++: goto cannot bypass variable initialization
- GPU section wrapped in a block so cleanup: label is within the same scope
- Skip path (no GPU) does early return instead of goto, avoiding crossing GPU allocs
- max_diff_W/max_diff_c moved to common scope within the GPU block
- nvcc (C++ mode) rejects goto bypassing for-loop variable declarations
- Split cleanup into 'cleanup' (non-GPU) and 'gpu_cleanup' (GPU)
- GPU skip path does direct return (no goto over GPU allocs)
- All loop variables declared at function scope, not in for-loop init
- gpu_cleanup label placed before any for-loop blocks
- rippra_cuda.h was missing declarations for dm_init, dm_free, and full_pipeline
- nvcc linker error when compiling test_cuda.c
- centroid_kernels.cu, dm_kernels.cu, matrix_kernels.cu were not part of any library target
- test_cuda (and any CUDA code) got linker errors because these .cu implementations were missing
- Also removed unused 'ok' variable from test_cuda.c to silence nvcc warning
- rippa_compute_centroids_refined was using scalar minmax + tcog_window
- Replace with tcog_window_fast() which dispatches to AVX2 at runtime
- Already-vectorized main centroiding path (PR #76) plus refined path complete the TCoG SIMD coverage
@purvanshjoshi
purvanshjoshi merged commit 04ed78e into main Jul 8, 2026
8 checks passed
github-actions Bot added a commit that referenced this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant