Stabilize GPU buffer lifecycle around regrid

This commit is contained in:
2026-04-09 20:48:06 +08:00
parent 46e94d1248
commit cf3c6d6218
8 changed files with 186 additions and 81 deletions

View File

@@ -1201,9 +1201,9 @@ int bssn_cuda_prolong3_pack(int wei,
if (wei != 3 || !llbc || !uubc || !extc || !func || !llbf || !uubf || !extf || !funf || !llbp || !uubp || !SoA)
return 1;
// The current input runs with equatorial symmetry enabled.
// The symmetry-aware prolong CUDA path is not numerically stable yet,
// so force a safe fallback to the original Fortran implementation.
// The symmetry-aware prolong CUDA path is still not equivalent to the
// active Cell/ghost_width=3 Fortran implementation, so keep the safe
// fallback for all symmetry-enabled cases.
if (symmetry != 0)
return 1;
@@ -1276,7 +1276,6 @@ int bssn_cuda_prolong3_pack(int wei,
// Current CUDA prolong path only supports the same fast path as the
// optimized Fortran code: interior stencil access without symmetry_bd().
// If the stencil touches the symmetry boundary, fall back to Fortran.
if (ic_min - 2 < 1 || jc_min - 2 < 1 || kc_min - 2 < 1)
return 1;