// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute // SPDX-License-Identifier: GPL-3.0-only #pragma once #include #include "ErrorModel.h" // FitErrorModel (ErrorModel.h) on the GPU. The bins hold the same samples, every normalised deviation // and so every bin median is the host's to the bit, and the update step is the host's own // (ErrorModelUpdate). What differs is the order each bin's two sums are added in - a fixed tree here, // the order nth_element left the bin in on the host - so a and b^2 can differ from the host fit in // their last bits. Deterministic: the same pool gives the same fit on every run. Only built with CUDA; // a device without room for about 72 bytes a sample throws (run on the CPU build then). ErrorModelFit FitErrorModelGPU(const std::vector &pool);