Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
counter.cpp
Go to the documentation of this file.
1 
14 #include "counter.h"
15 
16 #include "libkek.h"
17 
19 #include "IO/bridgeIO.h"
20 using Bridge::vout;
21 
22 int Counter::cid_static = 10;
23 //====================================================================
25 {
26  m_id = cid_static;
27  ++cid_static;
28 
30  vout.general(vl, "Counter_BGNET constructed with id = %d\n", m_id);
31 }
32 
33 
34 //====================================================================
36 {
37  KEK_FopCountStart(m_id);
38 }
39 
40 
41 //====================================================================
43 {
44  double time, gflops;
45 
46  finish(time, gflops);
47 
49  vout.general(vl, " time = %f GFlops = %f\n", time, gflops);
50 }
51 
52 
53 //====================================================================
54 void Counter::finish(double& time, double& gflops)
55 {
56  unsigned long count_op;
57  double time_op;
58 
59  KEK_FopCountFinish(m_id, &count_op, &time_op);
60 
61  time = time_op;
62  gflops = 1.e-9 * double(count_op) / time_op;
63 }
64 
65 
66 //====================================================================
67 //============================================================END=====
BridgeIO vout
Definition: bridgeIO.cpp:495
Counter()
Definition: counter.cpp:24
void general(const char *format,...)
Definition: bridgeIO.cpp:195
static Bridge::VerboseLevel Vlevel()
void finish()
Definition: counter.cpp:42
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:35
Bridge::VerboseLevel vl
Definition: checker.cpp:18
VerboseLevel
Definition: bridgeIO.h:42