~/talk

Vectorizing Computational Fluid Dynamics (CFD) Code in C++ Using std::simd

Talkat CppCon 2024 · on Sunday, 2024-09-15· [rust]
links:none on file
slides:none on file

Vectorizes a real CFD code with std::simd plus a small complementary library that makes loads/stores look like scalar code (implemented as a macro). Changes touch about 200 lines in the hot paths and add ~220 lines for reflection and helpers. Results are mixed: naive AVX2 vectorization sometimes slows down (division and masked lanes cost more), but explicit unrolling recovers roughly a 2× speedup in the sweet spot. Library is a working proof of concept.

AI-written summary · about

  1. 0:00Introduction to CFD coding
  2. 1:03Project goals and challenges
  3. 2:35CFD code context and CODA
  4. 4:43Scientific code vectorization
  5. 6:37Loop rearrangement strategies
  6. 9:39SIMD loop body transformation
  7. 11:53Index type deduction method
  8. 14:32The simd_access library
  9. 16:55SIMD_ACCESS library features
  10. 23:01Extended feature: reflections
  11. 27:26Extended feature: universal SIMD
  12. 31:49Handling conditions and masks
  13. 36:46Future extensions and gather
  14. 40:34C++ language improvement ideas
  15. 45:15Software engineering results
  16. 47:55Performance results and tuning
  17. 52:15Lessons learned and conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.