Optimize smoothing kernels and gradients#1117
Optimize smoothing kernels and gradients#1117efaulhaber wants to merge 28 commits intotrixi-framework:mainfrom
Conversation
|
/run-gpu-tests |
There was a problem hiding this comment.
Pull request overview
This PR refactors and optimizes smoothing kernel evaluation (kernels + gradients) for performance (including GPU considerations), and updates tests/examples accordingly.
Changes:
- Refactors smoothing kernels into “safe wrapper” APIs (
kernel,kernel_deriv,kernel_grad) plus_unsafefast paths and more optimized normalization-factor usage. - Updates WCSPH RHS hot loop to skip near-zero distances and call an unsafe kernel-gradient variant for speed.
- Adjusts kernel test coverage (integration slightly beyond support; derivative tests based on compact support) and re-enables a previously-disabled GPU example configuration.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/general/smoothing_kernels.jl |
Introduces _unsafe kernel/derivative/gradient implementations and refactors safe wrappers for performance/GPU behavior. |
src/general/abstract_system.jl |
Adds system-level skip_zero_distance and introduces a safe/unsafe split for smoothing_kernel_grad. |
src/schemes/fluid/weakly_compressible_sph/rhs.jl |
Uses the new zero-distance skipping and unsafe gradient path in the interaction loop. |
test/general/smoothing_kernels.jl |
Updates kernel integral/derivative tests to use compact support and verify zero outside support. |
test/examples/gpu.jl |
Re-enables the Schoenberg quartic spline kernel configuration in GPU tests/examples. |
src/TrixiParticles.jl |
Imports FastMath.div_fast for use in optimized derivative code paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/run-gpu-tests |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1117 +/- ##
===========================================
- Coverage 88.70% 67.03% -21.67%
===========================================
Files 128 128
Lines 9764 9808 +44
===========================================
- Hits 8661 6575 -2086
- Misses 1103 3233 +2130
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/run-gpu-tests |
|
/run-gpu-tests |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/run-gpu-tests |
|
/run-gpu-tests |
This PR:
_unsafeversions of kernel and gradient, which skip the compact support and zero distance checks (to be used inside the hot loops where this is guaranteed) and safe wrappers that add these checks again for "casual usage".Or, as @sloede said: