Skip to content

Commit

Permalink
Add gen-only flag to only build solver without solving (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
SallySoul authored Feb 3, 2025
1 parent 0bedc7c commit 5d019e6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/heat_1d_ap_fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ fn main() {
dot_path.push("plan.dot");
solver.to_dot_file(&dot_path);
}
if args.gen_only {
args.save_wisdom();
std::process::exit(0);
}

let mut img = None;
if args.write_image {
Expand Down
4 changes: 4 additions & 0 deletions examples/heat_2d_ap_fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ fn main() {
d_path.push("scratch.txt");
solver.scratch_descriptor_file(&d_path);
}
if args.gen_only {
args.save_wisdom();
std::process::exit(0);
}

// Create domains
let mut buffer_1 = OwnedDomain::new(grid_bound);
Expand Down
4 changes: 4 additions & 0 deletions examples/heat_3d_ap_fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ fn main() {
dot_path.push("plan.dot");
solver.to_dot_file(&dot_path);
}
if args.gen_only {
args.save_wisdom();
std::process::exit(0);
}

// Create domains
let mut buffer_1 = OwnedDomain::new(grid_bound);
Expand Down
4 changes: 4 additions & 0 deletions examples/time_varying_2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ fn main() {
d_path.push("scratch.txt");
solver.scratch_descriptor_file(&d_path);
}
if args.gen_only {
args.save_wisdom();
std::process::exit(0);
}

// Create domains
let mut buffer_1 = OwnedDomain::new(grid_bound);
Expand Down
4 changes: 4 additions & 0 deletions src/image_1d_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ pub struct Args {
/// Cutoff for fft solves
#[arg(long, default_value = "40")]
pub cutoff: i32,

/// Generate solver only, do not solve
#[arg(long)]
pub gen_only: bool,
}

impl Args {
Expand Down
4 changes: 4 additions & 0 deletions src/image_2d_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ pub struct Args {
/// Cutoff for fft solves
#[arg(long, default_value = "40")]
pub cutoff: i32,

/// Generate solver only, do not solve
#[arg(long)]
pub gen_only: bool,
}

impl Args {
Expand Down
4 changes: 4 additions & 0 deletions src/image_3d_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ pub struct Args {
/// Cutoff for fft solves
#[arg(long, default_value = "40")]
pub cutoff: i32,

/// Generate solver only, do not solve
#[arg(long)]
pub gen_only: bool,
}

impl Args {
Expand Down

0 comments on commit 5d019e6

Please sign in to comment.