From 5b94910fc4c6a47856290e9c23f9a905cf63c1eb Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 17 Apr 2019 14:38:23 +0200 Subject: Add and use a new timer API. --- ell_grid_solve.h | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) (limited to 'ell_grid_solve.h') diff --git a/ell_grid_solve.h b/ell_grid_solve.h index d46edd9..8f984ce 100644 --- a/ell_grid_solve.h +++ b/ell_grid_solve.h @@ -44,6 +44,7 @@ #include "mg2d_boundary.h" #include "mg2d_constants.h" #include "ndarray.h" +#include "timer.h" enum EGSType { /** @@ -84,20 +85,15 @@ typedef struct EGSRelaxContext { */ double relax_multiplier; - int64_t count_correct; - int64_t time_correct; + Timer timer_correct; } EGSRelaxContext; typedef struct EGSExactContext { - int64_t count_mat_construct; - int64_t time_mat_construct; - int64_t count_bicgstab_solve; + Timer timer_mat_construct; + Timer timer_bicgstab; int64_t bicgstab_iterations; - int64_t time_bicgstab_solve; - int64_t count_lu_solve; - int64_t time_lu_solve; - int64_t count_export; - int64_t time_export; + Timer timer_lu_solve; + Timer timer_export; } EGSExactContext; typedef struct EGSContext { @@ -195,21 +191,14 @@ typedef struct EGSContext { NDArray *diff_coeffs[MG2D_DIFF_COEFF_NB]; /* timings */ - int64_t time_boundaries; - int64_t count_boundaries; - int64_t time_bnd_fixval; - int64_t count_bnd_fixval; - int64_t time_bnd_falloff; - int64_t count_bnd_falloff; - int64_t time_bnd_reflect; - int64_t count_bnd_reflect; - int64_t time_bnd_corners; - int64_t count_bnd_corners; - int64_t time_res_calc; - int64_t count_res; - int64_t time_init; - int64_t count_init; - int64_t time_total; + Timer timer_bnd; + Timer timer_bnd_fixval; + Timer timer_bnd_falloff; + Timer timer_bnd_reflect; + Timer timer_bnd_corners; + Timer timer_res_calc; + Timer timer_init; + Timer timer_solve; } EGSContext; #define EGS_INIT_FLAG_SAME_DIFF_COEFFS (1 << 0) -- cgit v1.2.3