Skip to content

Make PST GPU-compatible#813

Merged
svchb merged 5 commits intotrixi-framework:mainfrom
efaulhaber:shifting-gpu
May 26, 2025
Merged

Make PST GPU-compatible#813
svchb merged 5 commits intotrixi-framework:mainfrom
efaulhaber:shifting-gpu

Conversation

@efaulhaber
Copy link
Copy Markdown
Member

@efaulhaber efaulhaber commented May 21, 2025

As requested by @LasNikas.

@efaulhaber efaulhaber marked this pull request as draft May 21, 2025 14:23
@efaulhaber efaulhaber self-assigned this May 21, 2025
@efaulhaber efaulhaber marked this pull request as ready for review May 21, 2025 14:32
@efaulhaber efaulhaber requested a review from Copilot May 21, 2025 14:32
@codecov
Copy link
Copy Markdown

codecov bot commented May 21, 2025

Codecov Report

Attention: Patch coverage is 54.54545% with 5 lines in your changes missing coverage. Please review.

Project coverage is 70.74%. Comparing base (6d04215) to head (41b0096).
Report is 56 commits behind head on main.

Files with missing lines Patch % Lines
src/callbacks/particle_shifting.jl 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #813      +/-   ##
==========================================
+ Coverage   70.53%   70.74%   +0.21%     
==========================================
  Files          96      106      +10     
  Lines        5976     6710     +734     
==========================================
+ Hits         4215     4747     +532     
- Misses       1761     1963     +202     
Flag Coverage Δ
unit 70.74% <54.54%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Aligns particle shifting and velocity extraction routines to be GPU-compatible by introducing specialized dispatch and buffer handling.

  • Adds current_velocity overloads for GPU-friendly extraction based on density calculators.
  • Refactors particle_shifting! to use a combined temp cache and replaces CPU-based max-velocity computation with a GPU-compatible approach.
  • Adjusts the literal for R to a rational form.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/schemes/fluid/weakly_compressible_sph/system.jl Added current_velocity methods for SummationDensity and ContinuityDensity
src/callbacks/particle_shifting.jl Renamed temp cache to vu_cache, replaced eachparticle max with reinterpret approach, and changed R literal
Comments suppressed due to low confidence (2)

src/schemes/fluid/weakly_compressible_sph/system.jl:254

  • [nitpick] Consider adding unit tests for both SummationDensity and ContinuityDensity cases of current_velocity to verify GPU-compatible behavior under different density calculators.
@inline function current_velocity(v, ::SummationDensity,

src/callbacks/particle_shifting.jl:68

  • SVector is used here but not imported in this file; add using StaticArrays: SVector at the top to prevent an undefined constant error.
reinterpret(reshape, SVector{ndims(system), eltype(v)},

Comment thread src/callbacks/particle_shifting.jl
Comment thread src/callbacks/particle_shifting.jl
Comment thread src/schemes/fluid/weakly_compressible_sph/system.jl
@efaulhaber efaulhaber requested review from LasNikas and svchb May 21, 2025 16:21
Comment thread src/schemes/fluid/weakly_compressible_sph/system.jl
@LasNikas
Copy link
Copy Markdown
Collaborator

\run-gpu-tests

@svchb
Copy link
Copy Markdown
Collaborator

svchb commented May 26, 2025

/run-gpu-tests

@svchb svchb enabled auto-merge (squash) May 26, 2025 11:30
@svchb svchb merged commit a73e6c4 into trixi-framework:main May 26, 2025
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants