Skip to content

Commit

Permalink
Fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tbetcke committed Jul 14, 2024
2 parents 51bea04 + 8ed7b82 commit 02ddb89
Show file tree
Hide file tree
Showing 12 changed files with 4,696 additions and 758 deletions.
33 changes: 31 additions & 2 deletions Cargo.toml
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."
Expand All @@ -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"]
Expand All @@ -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



11 changes: 6 additions & 5 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ To make a new release of green-kernels, follow the following steps:
to zero. If you are releasing a bugfix, you should increment `[z]`.

3) Commit your changes and push to GitHub, and check that all the tests on CI pass.
In `Cargo.toml`, check that the `rlst` dependency is at the latest version.

4) [Create a release on GitHub](https://github.com/bempp/green-kernels/releases/new) from the `release` branch.
4) Commit your changes and push to GitHub, and check that all the tests on CI pass.

5) [Create a release on GitHub](https://github.com/bempp/green-kernels/releases/new) from the `release` branch.
The release tag and title should be `v[x].[y].[z]` (where `[x]`, `[y]` and `[z]` are as in step 2).
In the "Describe this release" box, you should bullet point the main changes since the last
release.

6) In `Cargo.toml`, check that the `rlst` dependency is at the latest version.

7) Run `cargo publish --dry-run`, then run `cargo package --list` and
6) Run `cargo publish --dry-run`, then run `cargo package --list` and
check that no unwanted extras have been included in the release.

8) If everything is working as expected, run `cargo publish`. This will push the new version to
7) If everything is working as expected, run `cargo publish`. This will push the new version to
crates.io. Note: this cannot be undone, but you can use `cargo yank` to mark a version as
unsuitable for use.

Expand Down
45 changes: 45 additions & 0 deletions benches/helmholtz_c32.rs
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);
45 changes: 45 additions & 0 deletions benches/helmholtz_c64.rs
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);
45 changes: 45 additions & 0 deletions benches/laplace_f32.rs
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);
45 changes: 45 additions & 0 deletions benches/laplace_f64.rs
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);
Loading

0 comments on commit 02ddb89

Please sign in to comment.