Skip to content

Commit 31c9e7b

Browse files
committed
benchdnn: add finalize function
1 parent f3261e4 commit 31c9e7b

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

tests/benchdnn/benchdnn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int main(int argc, char **argv) {
150150
printf("total compute_ref: sum(s):%.2f\n", compute_ref_time_s);
151151
}
152152

153-
reset_gpu_profiling();
153+
finalize();
154154

155155
return !!benchdnn_stat.failed;
156156
}

tests/benchdnn/dnnl_common.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ void get_gpu_profiling_info(uint64_t &nsec, double &freq, int mode) {
356356
#endif
357357
}
358358

359+
void finalize() {
360+
reset_gpu_profiling();
361+
}
362+
359363
inline bool should_stop(const timer::timer_t &t) {
360364
const bool stop = false
361365
|| (fix_times_per_prb && t.times() >= fix_times_per_prb)

tests/benchdnn/dnnl_common.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,8 @@ int execute_and_wait(
670670
dnnl_primitive_t prim, const args_t &args, res_t *res = nullptr);
671671

672672
void reset_gpu_profiling();
673+
void finalize();
674+
673675
int measure_perf(const thr_ctx_t &ctx, res_t *res, perf_function_t &perf_func,
674676
args_t &args);
675677
int measure_perf(

0 commit comments

Comments
 (0)