@@ -52,6 +52,7 @@ pub fn run_stone_prover(
52
52
air_public_input : & PathBuf ,
53
53
air_private_input : & PathBuf ,
54
54
tmp_dir : & tempfile:: TempDir ,
55
+ bench_memory : bool ,
55
56
) -> Result < ( ) , ProverError > {
56
57
println ! ( "Running prover..." ) ;
57
58
@@ -65,6 +66,7 @@ pub fn run_stone_prover(
65
66
air_public_input,
66
67
air_private_input,
67
68
tmp_dir,
69
+ bench_memory,
68
70
) ?;
69
71
70
72
println ! ( "Prover finished successfully" ) ;
@@ -101,6 +103,7 @@ pub fn run_stone_prover_bootloader(
101
103
air_public_input,
102
104
air_private_input,
103
105
tmp_dir,
106
+ false ,
104
107
) ?;
105
108
106
109
println ! ( "Prover finished successfully" ) ;
@@ -118,6 +121,7 @@ fn run_stone_prover_internal(
118
121
air_public_input : & PathBuf ,
119
122
air_private_input : & PathBuf ,
120
123
tmp_dir : & tempfile:: TempDir ,
124
+ bench_memory : bool ,
121
125
) -> Result < ( ) , ProverError > {
122
126
let tmp_prover_parameters_path = tmp_dir. path ( ) . join ( "prover_parameters.json" ) ;
123
127
@@ -150,6 +154,7 @@ fn run_stone_prover_internal(
150
154
output_file,
151
155
true ,
152
156
stone_version,
157
+ bench_memory,
153
158
) ?;
154
159
155
160
Ok ( ( ) )
@@ -163,26 +168,47 @@ fn run_prover_from_command_line_with_annotations(
163
168
output_file : & PathBuf ,
164
169
generate_annotations : bool ,
165
170
stone_version : & StoneVersion ,
171
+ bench_memory : bool ,
166
172
) -> Result < ( ) , ProverError > {
167
173
// TODO: Add better error handling
168
174
let prover_run_path = match stone_version {
169
175
StoneVersion :: V5 => std:: env:: var ( "CPU_AIR_PROVER_V5" ) . unwrap ( ) ,
170
176
StoneVersion :: V6 => std:: env:: var ( "CPU_AIR_PROVER_V6" ) . unwrap ( ) ,
171
177
} ;
172
178
173
- let mut command = Command :: new ( "heaptrack" ) ;
174
- command
175
- . arg ( prover_run_path)
176
- . arg ( "--out-file" )
177
- . arg ( output_file)
178
- . arg ( "--public-input-file" )
179
- . arg ( public_input_file)
180
- . arg ( "--private-input-file" )
181
- . arg ( private_input_file)
182
- . arg ( "--prover-config-file" )
183
- . arg ( prover_config_file)
184
- . arg ( "--parameter-file" )
185
- . arg ( prover_parameter_file) ;
179
+ let mut command;
180
+ if bench_memory {
181
+ command = Command :: new ( "heaptrack" ) ;
182
+ command
183
+ . arg ( "-o" )
184
+ . arg ( "heaptrack-prover" )
185
+ . arg ( prover_run_path)
186
+ . arg ( "--out-file" )
187
+ . arg ( output_file)
188
+ . arg ( "--public-input-file" )
189
+ . arg ( public_input_file)
190
+ . arg ( "--private-input-file" )
191
+ . arg ( private_input_file)
192
+ . arg ( "--prover-config-file" )
193
+ . arg ( prover_config_file)
194
+ . arg ( "--parameter-file" )
195
+ . arg ( prover_parameter_file) ;
196
+ }
197
+ else {
198
+ command = Command :: new ( prover_run_path) ;
199
+ command
200
+ . arg ( "--out-file" )
201
+ . arg ( output_file)
202
+ . arg ( "--public-input-file" )
203
+ . arg ( public_input_file)
204
+ . arg ( "--private-input-file" )
205
+ . arg ( private_input_file)
206
+ . arg ( "--prover-config-file" )
207
+ . arg ( prover_config_file)
208
+ . arg ( "--parameter-file" )
209
+ . arg ( prover_parameter_file) ;
210
+ }
211
+
186
212
if generate_annotations {
187
213
command. arg ( "--generate-annotations" ) ;
188
214
}
0 commit comments