Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
counter.cpp
Go to the documentation of this file.
1 
5 #include "counter.h"
6 
7 #include "libkek.h"
8 
9 #include "commonParameters.h"
10 #include "bridgeIO.h"
11 using Bridge::vout;
12 
13 int Counter::cid_static = 10;
14 //====================================================================
16 {
17  m_id = cid_static;
18  ++cid_static;
19 
21  vout.general(vl, "Counter_BGNET constructed with id = %d\n", m_id);
22 }
23 
24 
25 //====================================================================
27 {
28  KEK_FopCountStart(m_id);
29 }
30 
31 
32 //====================================================================
34 {
35  double time, gflops;
36 
37  finish(time, gflops);
38 
40  vout.general(vl, " time = %f GFlops = %f\n", time, gflops);
41 }
42 
43 
44 //====================================================================
45 void Counter::finish(double& time, double& gflops)
46 {
47  unsigned long count_op;
48  double time_op;
49 
50  KEK_FopCountFinish(m_id, &count_op, &time_op);
51 
52  time = time_op;
53  gflops = 1.e-9 * double(count_op) / time_op;
54 }
55 
56 
57 //====================================================================
58 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:207
Counter()
Definition: counter.cpp:15
void general(const char *format,...)
Definition: bridgeIO.cpp:38
static Bridge::VerboseLevel Vlevel()
void finish()
Definition: counter.cpp:33
static int cid_static
static id to asign unique id to the instance.
Definition: counter.h:27
int m_id
counter id.
Definition: counter.h:26
void start()
Definition: counter.cpp:26
Bridge::VerboseLevel vl
Definition: checker.cpp:18
VerboseLevel
Definition: bridgeIO.h:25