Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gen-only flag to only build solver without solving #43

Merged
merged 1 commit into from
Feb 3, 2025
Merged
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
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
Loading