Skip to content

reg_field: add field_relax device dispatch + bump cpu/cuda pins - #36

Merged
balbasty merged 1 commit into
mainfrom
claude/jitfields-fastfields-migration-v5r416
Jul 27, 2026
Merged

reg_field: add field_relax device dispatch + bump cpu/cuda pins#36
balbasty merged 1 commit into
mainfrom
claude/jitfields-fastfields-migration-v5r416

Conversation

@balbasty

Copy link
Copy Markdown
Collaborator

Summary

Wires field_relax (in-place Gauss-Seidel relaxation for the field regulariser) through the device-dispatch boundary, mirroring the existing flow_relax dispatch:

  • Inspects sol.device.device_type and forwards to FF_CUDA::field_relax (guarded by FF_WITH_CUDA) or FF_CPU::field_relax.
  • Declared in reg_field.h with the same signature as the CPU/CUDA libraries: sol/hes/grd tensors, per-channel penalty vectors (absolute/membrane/bending), bound/ndim/nb_iter/stream.
  • Bumps submodule pins to the commits that add field_relax on each backend: cpu → fastfields-cpu-lib#37, cuda → fastfields-cuda-lib#23.

This completes the field_relax cascade through the C++/CUDA stack (kernels already had the device relax kernels; cpu-impl/cpu-lib and cuda-impl/cuda-lib are now merged; this is the last native layer before bind-py).

Testing

  • make all CXX=clang++ builds libfastfields-cpu.so and libfastfields.so clean.
  • Full cpu-lib test suite passes: 11 modules, 0 failures (test_reg_field: 463 checks, 0 failures).
  • CUDA path is compile+link validated only (no GPU in CI) — verified via fastfields-cuda-lib's reg_field.cpp under nvcc in the two merged upstream PRs.

🤖 Generated with Claude Code


Generated by Claude Code

Wire `field_relax` through the device-dispatch boundary: inspects
`sol.device.device_type` and forwards to `FF_CUDA::field_relax` (guarded by
FF_WITH_CUDA) or `FF_CPU::field_relax`, mirroring the existing
`flow_relax` dispatch. Declared in reg_field.h with the same signature as
the CPU/CUDA libraries (sol/hes/grd tensors, per-channel penalty vectors,
bound/ndim/nb_iter/stream).
Bump submodule pins to the commits that add field_relax on each backend:
cpu -> fastfields-cpu-lib#37, cuda -> fastfields-cuda-lib#23.
Verified: `make all CXX=clang++` builds libfastfields-cpu.so and
libfastfields.so clean; the cpu-lib test suite passes in full (11 modules,
0 failures, including reg_field's 463 checks).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
@balbasty
balbasty merged commit e80d841 into mainJul 27, 2026
@balbasty
balbasty deleted the claude/jitfields-fastfields-migration-v5r416 branch July 27, 2026 16:16
balbasty added a commit that referenced this pull request Jul 27, 2026
The previous pin-bump commit (#36) accidentally committed the dev-tree's
working-tree symlinks (`cpu -> ../fastfields-cpu-lib`, `cuda ->
../fastfields-cuda-lib`, used locally so the include chain resolves)
in place of the tracked submodule gitlinks, turning `cpu`/`cuda` from
160000 (commit/gitlink) entries into 120000 (plain symlink) blobs. A
fresh clone + `git submodule update` would silently fail to check out
either backend.
Restore both as proper gitlinks, bumping them to the current cpu-lib/
cuda-lib main tips (which also pulls in the field_relax pin-cascade
fixes and the RLS/JRLS CUHOST launchers) while doing so.
Verified: `make all CXX=clang++` builds libfastfields-cpu.so and
libfastfields.so clean.
Claude-Session: https://claude.ai/code/session_016AjQcY78NgbagPSbPJRr6Z
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@balbasty@claude