Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BLAS-join
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Google-TPU
BLAS-join
Commits
9e448a20
Commit
9e448a20
authored
Apr 17, 2018
by
Martin Perdacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed l1 cache measure
parent
db561393
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
36 deletions
+31
-36
cmake/measure/papicalls.cpp
cmake/measure/papicalls.cpp
+27
-29
cmake/measure/papicalls.h
cmake/measure/papicalls.h
+4
-7
No files found.
cmake/measure/papicalls.cpp
View file @
9e448a20
...
...
@@ -2,59 +2,57 @@
#include "papicalls.h"
PapiBin
::
PapiBin
(){
int
num_hwcntrs
;
if
((
num_hwcntrs
=
PAPI_num_counters
())
<
0
){
if
((
num_hwcntrs
=
PAPI_num_counters
())
<
NUM_EVENTS
){
fprintf
(
stderr
,
"Info:: This installation does not support PAPI: %s
\n
"
,
PAPI_strerror
(
num_hwcntrs
));
exit
(
1
);
}
}
if
((
num_hwcntrs
=
PAPI_num_counters
())
<
NUM_EVENTS
){
fprintf
(
stderr
,
"Info:: This machine does not provide sufficient hardware counters.
\n
"
);
exit
(
1
);
}
//
int num_hwcntrs;
//
if ((num_hwcntrs = PAPI_num_counters()) < 0 ){
//
if ((num_hwcntrs = PAPI_num_counters()) < NUM_EVENTS ){
//
fprintf(stderr,"Info:: This installation does not support PAPI: %s\n", PAPI_strerror(num_hwcntrs));
//
exit(1);
//
}
//
}
//
//
if ((num_hwcntrs = PAPI_num_counters()) < NUM_EVENTS ){
//
fprintf(stderr,"Info:: This machine does not provide sufficient hardware counters.\n");
//
exit(1);
//
}
}
void
PapiBin
::
start
(){
int
retval
=
0
;
counters
.
l1
=
0
;
// counters.l2 = 0; counters.l3 = 0;
//
counters.l1 = 0; // counters.l2 = 0; counters.l3 = 0;
// counters.rtime = 0.0; counters.ptime = 0.0; counters.flops = 0; counters.mflops;
// if ( ( retval = PAPI_flops( &counters.rtime, &counters.ptime, &counters.flops, &counters.mflops ) ) < PAPI_OK ){
// fprintf(stderr,"Call to PAPI_flops failed: %s\n", PAPI_strerror(retval));
// exit(1);
// }
energy_consume
.
reset
();
energy_consume
.
start
();
timer
.
start
();
if
((
retval
=
PAPI_start_counters
(
events
,
NUM_EVENTS
))
<
PAPI_OK
)
{
fprintf
(
stderr
,
"PAPI failed to start counters: %s
\n
"
,
PAPI_strerror
(
retval
));
exit
(
1
);
}
//
if ((retval = PAPI_start_counters(events, NUM_EVENTS)) < PAPI_OK) {
//
fprintf(stderr, "PAPI failed to start counters: %s\n", PAPI_strerror(retval));
//
exit(1);
//
}
}
void
PapiBin
::
stop
(){
int
retval
=
0
;
long_long
values
[
NUM_EVENTS
];
if
((
retval
=
PAPI_stop_counters
(
values
,
NUM_EVENTS
))
<
PAPI_OK
)
{
fprintf
(
stderr
,
"PAPI failed to start counters: %s
\n
"
,
PAPI_strerror
(
retval
));
exit
(
1
);
}
//
int retval=0;
//
long_long values[NUM_EVENTS];
//
//
if ((retval = PAPI_stop_counters(values, NUM_EVENTS)) < PAPI_OK) {
//
fprintf(stderr, "PAPI failed to start counters: %s\n", PAPI_strerror(retval));
//
exit(1);
//
}
// if ( ( retval = PAPI_flops( &counters.rtime, &counters.ptime, &counters.flops, &counters.mflops ) ) < PAPI_OK ){
// fprintf(stderr,"Call to PAPI_flops failed: %s\n", PAPI_strerror(retval));
// exit(1);
// }
timer
.
stop
();
counters
.
l1
=
values
[
0
];
energy_consume
.
stop
();
counters
.
rtime
=
timer
.
get_time
();
counters
.
whours
=
energy_consume
.
getWH
();
// unfortunately the following do not work for xeon-phi:
// counters.l2 = values[1];
// counters.l3 = values[2];
}
CounterBin
PapiBin
::
getBin
(){
...
...
cmake/measure/papicalls.h
View file @
9e448a20
...
...
@@ -8,17 +8,13 @@
#include <stdlib.h>
#include "timer.h"
#include "energy.h"
#define NUM_EVENTS 1
struct
CounterBin
{
long_long
l1
;
long_long
l2
;
// long_long l3;
double
whours
;
double
rtime
;
// float ptime;
// long_long flops;
// float mflops;
};
class
PapiBin
{
...
...
@@ -29,9 +25,10 @@ public:
CounterBin
getBin
();
private:
CUtilTimer
timer
;
Hioki
energy_consume
;
// const int NUM_EVENTS=3;
// int events[NUM_EVENTS] = { PAPI_L1_DCM , PAPI_L2_DCM, PAPI_L3_DCM };
int
events
[
NUM_EVENTS
]
=
{
PAPI_L1_DCM
};
//
int events[NUM_EVENTS] = { PAPI_L1_DCM };
CounterBin
counters
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment