Skip to content

Commit

Permalink
benchdnn: add finalize function
Browse files Browse the repository at this point in the history
  • Loading branch information
densamoilov committed Jan 20, 2023
1 parent f3261e4 commit 31c9e7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/benchdnn/benchdnn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int main(int argc, char **argv) {
printf("total compute_ref: sum(s):%.2f\n", compute_ref_time_s);
}

reset_gpu_profiling();
finalize();

return !!benchdnn_stat.failed;
}
4 changes: 4 additions & 0 deletions tests/benchdnn/dnnl_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ void get_gpu_profiling_info(uint64_t &nsec, double &freq, int mode) {
#endif
}

void finalize() {
reset_gpu_profiling();
}

inline bool should_stop(const timer::timer_t &t) {
const bool stop = false
|| (fix_times_per_prb && t.times() >= fix_times_per_prb)
Expand Down
2 changes: 2 additions & 0 deletions tests/benchdnn/dnnl_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,8 @@ int execute_and_wait(
dnnl_primitive_t prim, const args_t &args, res_t *res = nullptr);

void reset_gpu_profiling();
void finalize();

int measure_perf(const thr_ctx_t &ctx, res_t *res, perf_function_t &perf_func,
args_t &args);
int measure_perf(
Expand Down

0 comments on commit 31c9e7b

Please sign in to comment.