Skip to content

feat(simd): split imgproc SIMD helpers and add performance docs#26

Merged
kalwalt merged 3 commits intodevfrom
feat/SIMD-verification-improves
Mar 28, 2026
Merged

feat(simd): split imgproc SIMD helpers and add performance docs#26
kalwalt merged 3 commits intodevfrom
feat/SIMD-verification-improves

Conversation

@kalwalt
Copy link
Copy Markdown
Member

@kalwalt kalwalt commented Mar 28, 2026

Summary

  • Refactor (Issue Organization of SIMD files between core and imgproc: assessment and proposal #17): Moved 5 imgproc-specific SIMD functions (simd_rgb_to_gray_u8, simd_bgr_to_gray_u8, simd_rgba_to_gray_u8, simd_bgra_to_gray_u8, simd_deriv_3x3_row_f32) from src/core/simd.rs to a new src/imgproc/simd.rs module, improving separation of concerns.
  • Documentation (Issue SIMD plan #14 PR 5): Added # Performance doc comments to all SIMD-accelerated public APIs with measured speedups (e.g. 22× for sobel_3x3_f32). Updated CHANGELOG.
  • Tests: Added 4 new unit tests for previously untested SIMD kernels (bgr_to_gray, rgba_to_gray, bgra_to_gray, deriv_3x3_row_f32).

Closes #17
Refs #14

Test plan

  • cargo test — all 207 tests pass
  • cargo test --features simd — pass
  • cargo test --features "parallel,simd" — pass
  • cargo fmt --check — clean
  • cargo doc --no-deps — docs generate correctly
  • Re-run benchmarks to confirm no performance regression from the file split

🤖 Generated with Claude Code

kalwalt and others added 2 commits March 28, 2026 15:22
Move 5 imgproc-specific SIMD functions (simd_rgb_to_gray_u8,
simd_bgr_to_gray_u8, simd_rgba_to_gray_u8, simd_bgra_to_gray_u8,
simd_deriv_3x3_row_f32) from src/core/simd.rs to a new
src/imgproc/simd.rs module for better separation of concerns.

Adds unit tests for bgr, rgba, bgra color conversion and deriv_3x3
SIMD kernels that were previously untested directly.

Closes #17

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add # Performance doc comments to all SIMD-accelerated public APIs:
cvt_color_rgb/bgr/rgba/bgra_to_gray, sobel, scharr, threshold,
SimdElement trait, and internal SIMD kernels. Each documents measured
speedups from benchmark results (e.g. 22x for sobel_3x3_f32).

Update CHANGELOG.md with refactor and documentation entries.

Refs #14

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kalwalt kalwalt changed the base branch from main to dev March 28, 2026 14:36
Each top-level module (core/, imgproc/, features2d/, etc.) must contain
its own tests.rs and simd.rs with domain-specific SIMD kernels
co-located in the module that uses them.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kalwalt kalwalt self-assigned this Mar 28, 2026
@kalwalt kalwalt added documentation Improvements or additions to documentation enhancement New feature or request rust-code SIMD rust Pull requests that update rust code tests labels Mar 28, 2026
@kalwalt kalwalt merged commit 74c7ff7 into dev Mar 28, 2026
3 checks passed
@kalwalt kalwalt mentioned this pull request Mar 28, 2026
32 tasks
@kalwalt kalwalt deleted the feat/SIMD-verification-improves branch April 5, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request rust Pull requests that update rust code rust-code SIMD tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Organization of SIMD files between core and imgproc: assessment and proposal

1 participant