comparison util/ksvd utils/ompbox utils/ompprof.h @ 137:9207d56c5547 ivand_dev

New ompbox in utils for testing purposes
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Thu, 21 Jul 2011 14:07:41 +0100
parents
children
comparison
equal deleted inserted replaced
136:1334d2302dd9 137:9207d56c5547
1 /**************************************************************************
2 *
3 * File name: ompprof.h
4 *
5 * Ron Rubinstein
6 * Computer Science Department
7 * Technion, Haifa 32000 Israel
8 * ronrubin@cs
9 *
10 * Last Updated: 18.8.2009
11 *
12 * Collection of definitions and functions for profiling the OMP method.
13 *
14 *************************************************************************/
15
16
17 #ifndef __OMP_PROF_H__
18 #define __OMP_PROF_H__
19
20 #include "mex.h"
21 #include <time.h>
22
23
24
25 /**************************************************************************
26 *
27 * Constants and data types.
28 *
29 **************************************************************************/
30
31
32 /* constants denoting the various parts of the algorithm */
33
34 enum { DtX_TIME, XtX_TIME, DtR_TIME, MAXABS_TIME, DtD_TIME, LCHOL_TIME, COMPCOEF_TIME,
35 UPDATE_DtR_TIME, UPDATE_RESNORM_TIME, COMPRES_TIME, INDEXSORT_TIME };
36
37
38
39 /* profiling data container with counters for each part of the algorithm */
40
41 typedef struct profdata
42 {
43 clock_t prevtime; /* the time when last initialization/call to addproftime() was performed */
44
45 clock_t DtX_time;
46 clock_t XtX_time;
47 clock_t DtR_time;
48 clock_t maxabs_time;
49 clock_t DtD_time;
50 clock_t Lchol_time;
51 clock_t compcoef_time;
52 clock_t update_DtR_time;
53 clock_t update_resnorm_time;
54 clock_t compres_time;
55 clock_t indexsort_time;
56
57 /* flags indicating whether profiling data was gathered */
58 int DtX_time_counted;
59 int XtX_time_counted;
60 int DtR_time_counted;
61 int DtD_time_counted;
62 int update_DtR_time_counted;
63 int resnorm_time_counted;
64 int compres_time_counted;
65 int indexsort_time_counted;
66
67 } profdata;
68
69
70
71 /**************************************************************************
72 *
73 * Initialize a profdata structure, zero all counters, and start its timer.
74 *
75 **************************************************************************/
76 void initprofdata(profdata *pd);
77
78
79 /**************************************************************************
80 *
81 * Add elapsed time from last call to addproftime(), or from initialization
82 * of profdata, to the counter specified by comptype. comptype must be one
83 * of the constants in the enumeration above.
84 *
85 **************************************************************************/
86 void addproftime(profdata *pd, int comptype);
87
88
89 /**************************************************************************
90 *
91 * Print the current contents of the counters in profdata.
92 *
93 * Parameters:
94 * pd - the profdata to print
95 * erroromp - indicates whether error-based (nonzero) or sparsity-based (zero)
96 * omp was performed.
97 * batchomp - indicates whether batch-omp (nonzero) or omp-cholesky (zero)
98 * omp was performed.
99 * signum - number of signals processed by omp
100 *
101 **************************************************************************/
102 void printprofinfo(profdata *pd, int erroromp, int batchomp, int signum);
103
104
105 #endif
106