Skip to content

Migrate SIMD optimizations to Google Highway#123

Open
justnullname wants to merge 3 commits intomainfrom
jules-highway-optimization-15387880254359273585
Open

Migrate SIMD optimizations to Google Highway#123
justnullname wants to merge 3 commits intomainfrom
jules-highway-optimization-15387880254359273585

Conversation

@justnullname
Copy link
Copy Markdown
Owner

The change successfully migrates the image processing SIMD logic to Google Highway, fulfilling the task requirements.

  1. Highway Integration: Added highway dependency to vcpkg.json.
  2. SIMD Refactoring (SIMDUtils.h & ImageLoader.cpp): Replaced hand-coded AVX-512/AVX2 SIMD logic for PremultiplyAlpha_BGRA, SwizzleRGBA_to_BGRA_Premul, ResizeBilinear, FindPeak_R32G32B32A32_FLOAT, and ComputeHistogramFromFrame with Google Highway cross-platform abstractions.
  3. Dynamic Dispatch & Fallbacks: Utilized HWY_TARGETS configuration and HWY_STATIC_DISPATCH to automatically build optimized loops for multiple instruction sets (SSE4, AVX2, AVX-512, NEON), while safely retaining scalar fallbacks for edge-case tail lengths.
  4. Cleanup: Purged the obsolete IsProcessorFeaturePresent(PF_AVX2_INSTRUCTIONS_AVAILABLE) crash prompts in main.cpp, updated the SettingsOverlay string to indicate "Highway [Active]", and removed the MSBuild <EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet> constraint to allow graceful fallback to SSE4 on old CPUs.

PR created automatically by Jules for task 15387880254359273585 started by @justnullname

- Replaced manual AVX-512 and AVX2 intrinsics with Highway dynamic dispatch in SIMDUtils.h.
- Replaced AVX2 histogram calculation in ImageLoader.cpp with a Highway implementation.
- Removed legacy AVX2 CPU checks from main.cpp and SettingsOverlay.cpp.
- Added highway to vcpkg.json dependencies.
- Updated vcxproj to remove hardcoded AVX2 instruction set limits.
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Replaced manual AVX-512 and AVX2 intrinsics with Highway dynamic dispatch in SIMDUtils.h.
- Replaced AVX2 histogram calculation in ImageLoader.cpp with a Highway implementation.
- Removed legacy AVX2 CPU checks from main.cpp and SettingsOverlay.cpp.
- Added highway to vcpkg.json dependencies.
- Updated vcxproj to remove hardcoded AVX2 instruction set limits.
- Wrapped ComputeHistRow in a namespace (SIMD_ImageLoader).
- Used namespace qualification in HWY_DYNAMIC_DISPATCH and HWY_EXPORT to avoid C2065, C2737, and C2653 errors.
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