Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 88 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pineappl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ float-cmp = "0.9.0"
git-version = "0.3.5"
itertools = "0.10.1"
lz4_flex = "0.9.2"
nano-gemm = { git = "https://github.com/sarah-ek/nano-gemm", package = "nano-gemm" }
ndarray = { features = ["serde"], version = "0.15.4" }
rustc-hash = "1.1.0"
serde = { features = ["derive"], version = "1.0.130" }
Expand Down
40 changes: 36 additions & 4 deletions pineappl/src/evolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ use super::sparse_array3::SparseArray3;
use super::subgrid::{Mu2, Subgrid, SubgridEnum};
use float_cmp::approx_eq;
use itertools::Itertools;
use ndarray::linalg;
use ndarray::{s, Array1, Array2, Array3, ArrayView1, ArrayView4, Axis};
use ndarray::{s, Array1, Array2, Array3, ArrayView1, ArrayView2, ArrayView4, Axis};
use std::iter;

/// Number of ULPS used to de-duplicate grid values in [`Grid::evolve_info`].
Expand Down Expand Up @@ -170,6 +169,39 @@ fn gluon_has_pid_zero(grid: &Grid) -> bool {
&& grid.pid_basis() == PidBasis::Pdg
}

fn nano_gemm_mat_mul(
alpha: f64,
a: ArrayView2<f64>,
b: ArrayView2<f64>,
beta: f64,
c: &mut Array2<f64>,
) {
use nano_gemm::planless;

let ((m, k), (_, n)) = (a.dim(), b.dim());

unsafe {
planless::execute_f64(
m,
n,
k,
c.as_mut_ptr(),
c.strides()[0],
c.strides()[1],
a.as_ptr(),
a.strides()[0],
a.strides()[1],
b.as_ptr(),
b.strides()[0],
b.strides()[1],
beta,
alpha,
false,
false,
);
}
}

type Pid01IndexTuples = Vec<(usize, usize)>;
type Pid01Tuples = Vec<(i32, i32)>;

Expand Down Expand Up @@ -602,8 +634,8 @@ pub(crate) fn evolve_slice_with_two(
.map(|(opa, opb)| (fk_table, opa, opb))
},
) {
linalg::general_mat_mul(1.0, &array, &opb.t(), 0.0, &mut tmp);
linalg::general_mat_mul(factor, opa, &tmp, 1.0, fk_table);
nano_gemm_mat_mul(1.0, array.view(), opb.t(), 0.0, &mut tmp);
nano_gemm_mat_mul(factor, opa.view(), tmp.view(), 1.0, fk_table);
}
}
}
Expand Down