Files
Jungfraujoch/image_analysis/bragg_prediction/BraggPredictionGPU.h
T
leonarski_f 6c85aaba2b
Build Packages / Unit tests (push) Failing after 2s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 23m22s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 25m29s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 25m52s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 27m20s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 28m48s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 30m13s
Build Packages / build:rpm (rocky8) (push) Successful in 24m50s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 24m52s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 24m21s
Build Packages / XDS test (durin plugin) (push) Successful in 21m50s
Build Packages / Generate python client (push) Successful in 24s
Build Packages / Create release (push) Skipped
Build Packages / build:rpm (rocky9) (push) Successful in 27m59s
Build Packages / Build documentation (push) Successful in 1m18s
Build Packages / DIALS test (push) Successful in 31m37s
Build Packages / XDS test (JFJoch plugin) (push) Successful in 15m24s
Build Packages / XDS test (neggia plugin) (push) Successful in 13m11s
BraggPrediction: Include X-ray bandwidth
2026-06-09 15:01:44 +02:00

50 lines
1.2 KiB
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <vector>
#include "BraggPrediction.h"
#include "../indexing/CUDAMemHelpers.h"
struct KernelConsts {
float det_width_pxl;
float det_height_pxl;
float beam_x;
float beam_y;
float coeff_const;
float one_over_wavelength;
float one_over_dmax_sq;
float ewald_cutoff;
float bandwidth_sigma; // relative Δλ/λ (sigma); 0 = monochromatic
Coord Astar, Bstar, Cstar, S0;
float rot[9];
char centering;
};
class BraggPredictionGPU : public BraggPrediction {
CudaRegisteredVector<Reflection> reg_out; // requires stable storage
CudaDevicePtr<Reflection> d_out;
// Dedicated stream
CudaStream stream;
// Device allocations via helpers
CudaDevicePtr<KernelConsts> dK;
CudaDevicePtr<int> d_count;
// Host pinned buffer for async download (optional but faster)
CudaHostPtr<int> h_count;
public:
explicit BraggPredictionGPU(int max_reflections = 10000);
int Calc(const DiffractionExperiment &experiment,
const CrystalLattice &lattice,
const BraggPredictionSettings &settings) override;
};