aboutsummaryrefslogtreecommitdiff
path: root/zkvms_host_io/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'zkvms_host_io/src/lib.rs')
-rw-r--r--zkvms_host_io/src/lib.rs21
1 files changed, 20 insertions, 1 deletions
diff --git a/zkvms_host_io/src/lib.rs b/zkvms_host_io/src/lib.rs
index 7090023..46c4740 100644
--- a/zkvms_host_io/src/lib.rs
+++ b/zkvms_host_io/src/lib.rs
@@ -3,7 +3,7 @@ use num_traits::NumCast;
use serde::{ Serialize, Deserialize };
use env_file_reader::read_str;
use std::{env, option::Option, fs::read_to_string, collections::*};
-pub use input_macros::{ foreach_input_field, foreach_public_input_field, foreach_private_input_field };
+pub use input_macros::{ foreach_input_field, foreach_public_input_field, foreach_private_input_field, benchmarkable };
static DEFAULT_PUBLIC_INPUT: &str = include_str!(concat!(env!("INPUTS_DIR"), "/default_public_input.toml"));
static DEFAULT_PRIVATE_INPUT: &str = include_str!(concat!(env!("INPUTS_DIR"), "/default_private_input.toml"));
@@ -18,6 +18,15 @@ struct Cli {
private_input: Option<String>,
public_input: Option<String>,
+
+ #[arg(short, long)]
+ benchmark: bool,
+
+ #[arg(short, long, requires = "benchmark")]
+ repeat: Option<usize>,
+
+ #[arg(short, long, requires = "benchmark")]
+ metrics_output: Option<String>,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
@@ -30,9 +39,14 @@ pub enum RunType {
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RunWith {
pub run_type: RunType,
+ pub benchmarking: bool,
+ pub repeats: usize,
+ pub output_file: Option<String>,
+
pub input: Input,
pub public_input: PublicInput,
pub private_input: PrivateInput,
+
pub default_env: HashMap<String, String>,
}
@@ -76,9 +90,14 @@ pub fn read_args() -> RunWith {
RunWith {
run_type: cli.run_type,
+ benchmarking: cli.benchmark,
+ repeats: cli.repeat.unwrap_or(1),
+ output_file: cli.metrics_output,
+
input,
public_input,
private_input,
+
default_env,
}
}