Skip to content

test_seam_interpolation_fnl_kernels

Device kernels for the seam-interpolation device test: MODULE-LEVEL subroutines (the adam_fnl_field_kernels production shape — NOT contained kernels, whose private arrays are untrustworthy on nvfortran, see CLAUDE-gpu / #22 F1-bis). Each kernel gathers its case data SCALAR-WISE from shared device arrays into CONSTANT-BOUND private arrays, then calls the single-source !$acc routine seq evaluators with whole-array actuals: no array sections cross a device call boundary (nvfortran materializes such sections into copy-in temporaries — the F1-bis race shape — and a host-side contiguous repack of a device pointer segfaults outright). This is EXACTLY the pattern the F3 fill kernels must use.

Source: src/tests/amr/test_seam_interpolation_fnl.F90

Dependencies

Contents

Subroutines

dump_tables_dev

Copy the module parameter weight tables into device arrays, element-wise from device code: pins the GA3 parameter-residency risk in isolation.

fortran
subroutine dump_tables_dev(w4_dev, w3_dev, wq_dev)

Arguments

NameTypeIntentAttributesDescription
w4_devreal(kind=R8P)inoutDevice copy of SEAM_W_TRICUBIC.
w3_devreal(kind=R8P)inoutDevice copy of SEAM_W_COMPATIBLE.
wq_devreal(kind=R8P)inoutDevice copy of SEAM_W_QUADRATIC.

eval_tricubic_dev

Evaluate the tricubic interpolant on device, one thread per case: scalar gather into constant-bound private arrays, whole-array call.

fortran
subroutine eval_tricubic_dev(ncase, fp_dev, sub_dev, pos_dev, got_dev)

Arguments

NameTypeIntentAttributesDescription
ncaseinteger(kind=I4P)inNumber of cases.
fp_devreal(kind=R8P)inFootprints (4,4,4,ncase).
sub_devinteger(kind=I4P)inOctant sub-positions (3,ncase).
pos_devinteger(kind=I4P)inAnchor positions (3,ncase).
got_devreal(kind=R8P)inoutInterpolated values (ncase).

Call graph

eval_compatible_dev

Evaluate the restriction-compatible interpolant on device, one thread per case.

fortran
subroutine eval_compatible_dev(ncase, fp_dev, sub_dev, pos_dev, got_dev)

Arguments

NameTypeIntentAttributesDescription
ncaseinteger(kind=I4P)inNumber of cases.
fp_devreal(kind=R8P)inFootprints (3,3,3,ncase).
sub_devinteger(kind=I4P)inOctant sub-positions (3,ncase).
pos_devinteger(kind=I4P)inAnchor positions (3,ncase).
got_devreal(kind=R8P)inoutInterpolated values (ncase).

Call graph

eval_quadratic_dev

Evaluate the centered quadratic interpolant on device, one thread per case.

fortran
subroutine eval_quadratic_dev(ncase, fp_dev, sub_dev, got_dev)

Arguments

NameTypeIntentAttributesDescription
ncaseinteger(kind=I4P)inNumber of cases.
fp_devreal(kind=R8P)inFootprints (3,3,3,ncase).
sub_devinteger(kind=I4P)inOctant sub-positions (3,ncase).
got_devreal(kind=R8P)inoutInterpolated values (ncase).

Call graph

meta_roundtrip_dev

Pack then unpack the per-ghost metadata on device (ishft/ibits in device code): each thread round-trips its own case through the packed integer.

fortran
subroutine meta_roundtrip_dev(ncase, sub_dev, p4_dev, p3_dev, meta_dev, osub_dev, op4_dev, op3_dev)

Arguments

NameTypeIntentAttributesDescription
ncaseinteger(kind=I4P)inNumber of cases.
sub_devinteger(kind=I4P)inOctant sub-positions in (3,ncase).
p4_devinteger(kind=I4P)inTricubic anchor positions in (3,ncase).
p3_devinteger(kind=I4P)inCompatible anchor positions in (3,ncase).
meta_devinteger(kind=I4P)inoutPacked metadata out (ncase).
osub_devinteger(kind=I4P)inoutUnpacked sub-positions out (3,ncase).
op4_devinteger(kind=I4P)inoutUnpacked tricubic positions out (3,ncase).
op3_devinteger(kind=I4P)inoutUnpacked compatible positions out (3,ncase).

Call graph

shift_clamp_dev

Compute the centered anchor position and the shift-inward clamp on device, one thread per case (scalar arguments only: no gather needed).

fortran
subroutine shift_clamp_dev(ncase, anchor_dev, ncell_dev, subv_dev, fpn_dev, pc_dev, p_dev)

Arguments

NameTypeIntentAttributesDescription
ncaseinteger(kind=I4P)inNumber of cases.
anchor_devinteger(kind=I4P)inDonor anchor cell indexes (ncase).
ncell_devinteger(kind=I4P)inDonor block interior cell counts (ncase).
subv_devinteger(kind=I4P)inOctant sub-positions (ncase).
fpn_devinteger(kind=I4P)inFootprint widths, 4 tricubic | 3 compatible (ncase).
pc_devinteger(kind=I4P)inoutCentered anchor positions out (ncase).
p_devinteger(kind=I4P)inoutClamped anchor positions out (ncase).

Call graph