Further improve TLSPH deformation gradient performance on GPUs in 2D#1149
Conversation
efaulhaber
commented
Apr 21, 2026
| main new 2D | main new 3D | this PR 2D | this PR 3D | |
|---|---|---|---|---|
| PK1 FP32 | 0.872 ms | 3.155 ms | 0.632 ms (1.38x) | 3.128 ms (1.01x) |
| PK1 FP64 | 1.397 ms | 6.042 ms | 1.048 ms (1.33x) | 5.904 ms (1.02x) |
There was a problem hiding this comment.
Pull request overview
This PR targets GPU performance improvements for Total Lagrangian SPH (TLSPH) deformation-related computations, primarily in 2D, by reducing unnecessary memory operations and using faster division in a hot loop.
Changes:
- Avoids resetting the deformation gradient buffer by overwriting per-particle values directly.
- Uses
div_fastfor per-neighbor volume computation to reduce division cost in the deformation gradient loop. - Minor comment wording update regarding Float64→Float32 conversion on GPUs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/schemes/structure/total_lagrangian_sph/system.jl |
Removes full-buffer zeroing and switches to per-particle overwrite; uses div_fast for neighbor volume computation in deformation gradient calculation. |
src/schemes/structure/total_lagrangian_sph/rhs.jl |
Comment-only tweak clarifying Float64→Float32 conversion wording. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1149 +/- ##
==========================================
- Coverage 88.97% 88.97% -0.01%
==========================================
Files 129 129
Lines 9981 9980 -1
==========================================
- Hits 8881 8880 -1
Misses 1100 1100
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 |