Skip to content
Projects

tree_d_3d.kernels.pair_energy.pair_energy_metal

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

pair_energy_pyccel.py next to this file is the CPU version with the same arguments. One thread per particle i sums its pairs with j > i into its own entry of partial (float32); the host adds the sum of partial, in float64, to energy[0]. See :mod:tree_d_3d.kernels._metal.

Functions

NameDescription
pair_energyAdd the pair sum of q_i q_j / sqrt(r2 + eps2) to energy[0] on the GPU.

pair_energyfunction#

def pair_energy(pos: Array, charge: Array, softening: float, status: Array, energy: Array) -> None

Add the pair sum of q_i q_j / sqrt(r2 + eps2) to energy[0] on the GPU.