vibespatial.constructive.centroid¶
GPU-accelerated centroid computation for all geometry types.
Tier 1 NVRTC kernels (ADR-0033) for computing geometric centroids directly from OwnedGeometryArray coordinate buffers. ADR-0002 METRIC class precision dispatch: fp32 + Kahan + coordinate centering on consumer GPUs, native fp64 on datacenter GPUs.
Covers Point, MultiPoint, LineString, MultiLineString, Polygon, and MultiPolygon families. Polygon/MultiPolygon kernel source is imported from polygon_constructive.py (not duplicated).
Zero host/device transfers mid-process. When data is already device-resident (vibeFrame path), kernels read directly from DeviceFamilyGeometryBuffer pointers with no copy.
Attributes¶
Functions¶
|
Compute centroid directly from OwnedGeometryArray coordinate buffers. |
Module Contents¶
- vibespatial.constructive.centroid.cp = None¶
- vibespatial.constructive.centroid.centroid_owned(owned: vibespatial.geometry.owned.OwnedGeometryArray, *, dispatch_mode: vibespatial.runtime.ExecutionMode | str = ExecutionMode.AUTO, precision: vibespatial.runtime.precision.PrecisionMode | str = 'auto') vibespatial.geometry.owned.OwnedGeometryArray¶
Compute centroid directly from OwnedGeometryArray coordinate buffers.
Supports all geometry families: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon.
GPU path uses ADR-0002 METRIC-class precision dispatch. Returns a device-resident Point OwnedGeometryArray (GPU path) or host-resident Point OwnedGeometryArray (CPU path).
Zero host/device transfers mid-process. When owned.device_state is populated (vibeFrame path), GPU kernels read directly from device pointers with no copy.