-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
4,696 additions
and
758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
[features] | ||
nightly = ["pulp/nightly"] | ||
# Treat warnings as a build error. | ||
strict = [] | ||
|
||
[package] | ||
name = "green-kernels" | ||
version = "0.1.0" | ||
version = "0.1.0-dev" | ||
edition = "2021" | ||
authors = ["Timo Betcke <[email protected]>", "Matthew Scroggs <[email protected]>"] | ||
description = "Evaluation of Green's function kernels." | ||
|
@@ -26,8 +27,17 @@ approx = { version = "0.5", features = ["num-complex"] } | |
rayon = "1.9" | ||
num = "0.4" | ||
num_cpus = "1" | ||
rlst = { version = "0.1.0" } | ||
rlst = { version = "0.2", features = ["sleef"] } | ||
rand = "0.8.5" | ||
itertools = { version = "0.13.0", default-features = false } | ||
coe-rs = "0.1.2" | ||
pulp = { version = "0.18.12" } | ||
bytemuck = "1.16.0" | ||
hexf = "0.2.1" | ||
|
||
[dev-dependencies] | ||
criterion = { version = "0.5.1", features = ["html_reports"] } | ||
rand_chacha = "0.3" | ||
|
||
[package.metadata.docs.rs] | ||
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"] | ||
|
@@ -43,3 +53,22 @@ lapack-src = { version = "0.10", features = ["accelerate"]} | |
blas-src = { version = "0.10", features = ["blis"]} | ||
lapack-src = { version = "0.10", features = ["netlib"]} | ||
|
||
|
||
[[bench]] | ||
name = "laplace_f32" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "laplace_f64" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "helmholtz_c32" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "helmholtz_c64" | ||
harness = false | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
|
||
extern crate blas_src; | ||
extern crate lapack_src; | ||
|
||
use rlst::prelude::*; | ||
|
||
use green_kernels::helmholtz_3d::Helmholtz3dKernel; | ||
use green_kernels::traits::Kernel; | ||
use green_kernels::types::EvalType; | ||
|
||
use rand::SeedableRng; | ||
|
||
const NPOINTS: usize = 1000; | ||
|
||
pub fn helmholtz_c32_test_standard(c: &mut Criterion) { | ||
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0); | ||
|
||
let mut sources = rlst_dynamic_array2!(f32, [3, NPOINTS]); | ||
let mut targets = rlst_dynamic_array2!(f32, [3, NPOINTS]); | ||
|
||
let mut charges = rlst_dynamic_array1!(c32, [NPOINTS]); | ||
|
||
let mut result = rlst_dynamic_array1!(c32, [NPOINTS]); | ||
|
||
sources.fill_from_equally_distributed(&mut rng); | ||
targets.fill_from(sources.view()); | ||
|
||
charges.fill_from_standard_normal(&mut rng); | ||
|
||
c.bench_function("Helmholtz evaluate c32", |b| { | ||
b.iter(|| { | ||
Helmholtz3dKernel::<c32>::new(1.0).evaluate_st( | ||
EvalType::Value, | ||
sources.data(), | ||
targets.data(), | ||
charges.data(), | ||
result.data_mut(), | ||
); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, helmholtz_c32_test_standard,); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
|
||
extern crate blas_src; | ||
extern crate lapack_src; | ||
|
||
use rlst::prelude::*; | ||
|
||
use green_kernels::helmholtz_3d::Helmholtz3dKernel; | ||
use green_kernels::traits::Kernel; | ||
use green_kernels::types::EvalType; | ||
|
||
use rand::SeedableRng; | ||
|
||
const NPOINTS: usize = 1000; | ||
|
||
pub fn helmholtz_c64_test_standard(c: &mut Criterion) { | ||
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0); | ||
|
||
let mut sources = rlst_dynamic_array2!(f64, [3, NPOINTS]); | ||
let mut targets = rlst_dynamic_array2!(f64, [3, NPOINTS]); | ||
|
||
let mut charges = rlst_dynamic_array1!(c64, [NPOINTS]); | ||
|
||
let mut result = rlst_dynamic_array1!(c64, [NPOINTS]); | ||
|
||
sources.fill_from_equally_distributed(&mut rng); | ||
targets.fill_from(sources.view()); | ||
|
||
charges.fill_from_standard_normal(&mut rng); | ||
|
||
c.bench_function("Helmholtz evaluate c64", |b| { | ||
b.iter(|| { | ||
Helmholtz3dKernel::<c64>::new(1.0).evaluate_st( | ||
EvalType::Value, | ||
sources.data(), | ||
targets.data(), | ||
charges.data(), | ||
result.data_mut(), | ||
); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, helmholtz_c64_test_standard,); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
|
||
extern crate blas_src; | ||
extern crate lapack_src; | ||
|
||
use rlst::prelude::*; | ||
|
||
use green_kernels::laplace_3d::Laplace3dKernel; | ||
use green_kernels::traits::Kernel; | ||
use green_kernels::types::EvalType; | ||
|
||
use rand::SeedableRng; | ||
|
||
const NPOINTS: usize = 1000; | ||
|
||
pub fn laplace_f32_test_standard(c: &mut Criterion) { | ||
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0); | ||
|
||
let mut sources = rlst_dynamic_array2!(f32, [3, NPOINTS]); | ||
let mut targets = rlst_dynamic_array2!(f32, [3, NPOINTS]); | ||
|
||
let mut charges = rlst_dynamic_array1!(f32, [NPOINTS]); | ||
|
||
let mut result = rlst_dynamic_array1!(f32, [NPOINTS]); | ||
|
||
sources.fill_from_equally_distributed(&mut rng); | ||
targets.fill_from(sources.view()); | ||
|
||
charges.fill_from_standard_normal(&mut rng); | ||
|
||
c.bench_function("Laplace evaluate f32", |b| { | ||
b.iter(|| { | ||
Laplace3dKernel::<f32>::new().evaluate_st( | ||
EvalType::Value, | ||
sources.data(), | ||
targets.data(), | ||
charges.data(), | ||
result.data_mut(), | ||
); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, laplace_f32_test_standard,); | ||
criterion_main!(benches); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
|
||
extern crate blas_src; | ||
extern crate lapack_src; | ||
|
||
use rlst::prelude::*; | ||
|
||
use green_kernels::laplace_3d::Laplace3dKernel; | ||
use green_kernels::traits::Kernel; | ||
use green_kernels::types::EvalType; | ||
|
||
use rand::SeedableRng; | ||
|
||
const NPOINTS: usize = 1000; | ||
|
||
pub fn laplace_f64_test_standard(c: &mut Criterion) { | ||
let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0); | ||
|
||
let mut sources = rlst_dynamic_array2!(f64, [3, NPOINTS]); | ||
let mut targets = rlst_dynamic_array2!(f64, [3, NPOINTS]); | ||
|
||
let mut charges = rlst_dynamic_array1!(f64, [NPOINTS]); | ||
|
||
let mut result = rlst_dynamic_array1!(f64, [NPOINTS]); | ||
|
||
sources.fill_from_equally_distributed(&mut rng); | ||
targets.fill_from(sources.view()); | ||
|
||
charges.fill_from_standard_normal(&mut rng); | ||
|
||
c.bench_function("Laplace f64 evaluate", |b| { | ||
b.iter(|| { | ||
Laplace3dKernel::<f64>::new().evaluate_st( | ||
EvalType::Value, | ||
sources.data(), | ||
targets.data(), | ||
charges.data(), | ||
result.data_mut(), | ||
); | ||
}) | ||
}); | ||
} | ||
|
||
criterion_group!(benches, laplace_f64_test_standard,); | ||
criterion_main!(benches); |
Oops, something went wrong.