Skip to content
Projects

tree_d_3d.kernels.quadtree_quadrants.quadtree_quadrants_metal

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

quadtree_quadrants_pyccel.py next to this file is the CPU version with the same arguments. One thread per sorted slot; see :mod:tree_d_3d.kernels._metal. pos is (2, N) (component-major). Positions are compared with the node centres in float32, so a particle within about 1e-7 of a centre line can fall into the other quadrant than on the CPU.

Functions

NameDescription
quadtree_quadrantsThe child quadrant of every sorted particle (-1: its node does not split).

quadtree_quadrantsfunction#

def quadtree_quadrants(pos: Array, perm: Array, slot_node: Array, node_center: Array, node_child: Array, quadrant: Array) -> None

The child quadrant of every sorted particle (-1: its node does not split).