FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpp-taskflow/benchmark/wavefront/main.cpp at master · fcccode/cpp-taskflow · GitHub
fcccode
/
cpp-taskflow
Public
forked from
taskflow/taskflow
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpp-taskflow
/
benchmark
/
wavefront
/
main.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
52 lines (39 loc) · 1.28 KB
Breadcrumbs
cpp-taskflow
/
benchmark
/
wavefront
/
main.cpp
Copy path
File metadata and controls
52 lines (39 loc) · 1.28 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
include
"
matrix.hpp
"
int
main
(
int
argc,
char
* argv[]) {
unsigned
num_threads =
std::thread::hardware_concurrency
();
if
(argc >
1
) {
num_threads =
std::atoi
(argv[
1
]);
}
int
rounds {
5
};
std::cout <<
std::setw
(
12
) <<
"
# blocks
"
<<
std::setw
(
12
) <<
"
OpenMP
"
<<
std::setw
(
12
) <<
"
TBB
"
<<
std::setw
(
12
) <<
"
Taskflow
"
<<
std::setw
(
12
) <<
"
speedup1
"
<<
std::setw
(
12
) <<
"
speedup2
"
<<
'
\n
'
;
for
(
int
S=
32
; S<=
4096
; S +=
128
) {
M = N = S;
B =
8
;
MB
= (M/B) + (M%B>
0
);
NB
= (N/B) + (N%B>
0
);
double
omp_time {
0.0
};
double
tbb_time {
0.0
};
double
tf_time {
0.0
};
init_matrix
();
for
(
int
j=
0
; j<rounds; ++j) {
omp_time +=
measure_time_omp
(num_threads).
count
();
tbb_time +=
measure_time_tbb
(num_threads).
count
();
tf_time +=
measure_time_taskflow
(num_threads).
count
();
}
destroy_matrix
();
std::cout <<
std::setw
(
12
) <<
MB
*
NB
<<
std::setw
(
12
) << omp_time / rounds /
1e3
<<
std::setw
(
12
) << tbb_time / rounds /
1e3
<<
std::setw
(
12
) << tf_time / rounds /
1e3
<<
std::setw
(
12
) << omp_time / tf_time
<<
std::setw
(
12
) << tbb_time / tf_time
<< std::endl;
}
return
0
;
}
Back
|
FazBrowse Home
|
New Git URL