Skip to content
Projects

tree_d_3d.kernels.soften_pairs.soften_pairs_metal

The Metal version (Apple-silicon GPU, float32) of the soften_pairs kernel.

soften_pairs_pyccel.py next to this file is the CPU version with the same arguments. One thread per pair adds into zeroed atomic float32 delta arrays (see :mod:tree_d_3d.kernels._metal_atomic); the host adds those to phi and field in float64. A pair at zero separation sets status[0] to its index + 1 (the first such pair; the other pairs are still applied).

Functions

NameDescription
soften_pairsAdd the softened-minus-bare kernel of the listed pairs to both partners.

soften_pairsfunction#

def soften_pairs(pos: Array, charge: Array, pairs: Array, eps2: float, with_potential: int, phi: Array, field: Array, status: Array) -> None

Add the softened-minus-bare kernel of the listed pairs to both partners.