Build Packages / Create release (push) Successful in 9s
Build Packages / build:portable:macos-arm64:nocuda (push) Successful in 5m8s
Build Packages / build:rugnux:linux-aarch64:cuda (push) Successful in 11m12s
Build Packages / build:portable:linux-x86_64:nocuda (push) Successful in 16m43s
Build Packages / build:portable:linux-x86_64:cuda (push) Successful in 20m56s
Build Packages / build:portable:windows-x86_64:nocuda (push) Successful in 22m4s
Build Packages / build:jfjoch:rocky8:nocuda (push) Successful in 26m57s
Build Packages / HDF5 consumer tests (DIALS, XDS) (push) Successful in 28m24s
Build Packages / build:jfjoch:rocky9:nocuda (push) Successful in 27m58s
Build Packages / build:portable:windows-x86_64:cuda (push) Successful in 29m29s
Build Packages / build:jfjoch:ubuntu2204:nocuda (push) Successful in 18m23s
Build Packages / build:jfjoch:ubuntu2404:nocuda (push) Successful in 19m55s
Build Packages / Generate python client (push) Successful in 32s
Build Packages / Build documentation (push) Successful in 1m32s
Build Packages / build:jfjoch:rocky8:cuda-sls9 (push) Successful in 27m20s
Build Packages / build:jfjoch:ubuntu2204:cuda (push) Successful in 29m27s
Build Packages / build:jfjoch:ubuntu2404:cuda (push) Successful in 32m41s
Build Packages / build:jfjoch:rocky8:cuda (push) Successful in 34m46s
Build Packages / build:jfjoch:rocky9:cuda-sls9 (push) Successful in 37m25s
Build Packages / build:jfjoch:rocky9:cuda (push) Successful in 35m56s
Build Packages / Unit tests (push) Successful in 2h8m44s
Build Packages / Validation Battery (push) Successful in 33m35s
* jfjoch_broker: Optional live Rugnux analysis of DECTRIS rotation collections inside the broker, with merged data, maps and the placed model written beside the master file, the rotation lattice in the scan result, and a "Rugnux live" tab and dashboard row in the web frontend. * Rugnux: Faster processing, with molecular replacement and model validation spread over several GPUs and run on the Apple GPU on macOS. * Rugnux: The polarization stated in miniCBF and d*TREK headers is used, twinned crystals' space groups are decided more reliably, and a run that finds no lattice still reports every image. Reviewed-on: #86 Co-authored-by: Filip Leonarski <filip.leonarski@psi.ch>
43 lines
2.2 KiB
C++
43 lines
2.2 KiB
C++
// SPDX-FileCopyrightText: 2026 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
// PutModelDensityOnGrid()'s density (ModelGrid.cpp) on an Apple GPU (macOS only), before the symmetrize: the same
|
|
// grid, bit for bit. A gather, as ModelDensityGPU.cu's under CUDA: the grid is cut into bricks of 4^3 points,
|
|
// one threadgroup each, and every point adds, in model order, each atom whose box holds it and whose radius
|
|
// reaches it - the points UseDensityBoxesByPlane() hands the atom, with the same single-precision arithmetic
|
|
// (ModelDensityMetal.metal spells it out), gemmi's float expapprox and the same order of the sums. Nothing is
|
|
// summed with an atomic. tests/ModelDensityMetalTest.cpp holds it to the CPU's grid.
|
|
|
|
#include <cstddef>
|
|
#include <vector>
|
|
|
|
// One atom, as ModelGrid.cpp's DensityBox and AtomDensity hold it: its box about the grid point c nearest its
|
|
// centre, c - d to c + d; gemmi's five Gaussians of the isotropic or the anisotropic density.
|
|
struct ModelDensityMetalAtom {
|
|
float nctr[3]; // the centre in grid units
|
|
int c[3], d[3];
|
|
float max_r2; // the radius squared
|
|
float occ;
|
|
int aniso; // 0: b[k][0] multiplies r^2; 1: b[k] is u11 u22 u33 u12 u13 u23
|
|
float a[5];
|
|
float b[5][6];
|
|
};
|
|
|
|
// The grid, u fastest, and gemmi's orth_n over its size in single precision (upper triangular).
|
|
struct ModelDensityMetalGrid {
|
|
int nu = 0, nv = 0, nw = 0;
|
|
float m00 = 0, m01 = 0, m02 = 0, m11 = 0, m12 = 0, m22 = 0;
|
|
};
|
|
|
|
// The density of `atoms` into `out` (nu nv nw floats, every point written) on the GPU. False where it is not
|
|
// taken there - no Metal device the process may use (rugnux --no-gpu hides it, see hide_gpus), or an atom whose
|
|
// box is wider than the cell, which reaches a point through two images;
|
|
// `out` is then untouched. `nthreads` CPU threads sort the atoms into the bricks. Throws JFJochException on a
|
|
// Metal failure.
|
|
bool ModelDensityMetal(const ModelDensityMetalGrid &grid, const std::vector<ModelDensityMetalAtom> &atoms, float *out,
|
|
size_t nthreads);
|
|
// How many grids the GPU has put the density on in this process.
|
|
size_t ModelDensityMetalGrids();
|