FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
taskflow/benchmarks/wavefront/taskflow.cpp at master · ModuleWorks/taskflow · GitHub
ModuleWorks
/
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
taskflow
/
benchmarks
/
wavefront
/
taskflow.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (32 loc) · 977 Bytes
Breadcrumbs
taskflow
/
benchmarks
/
wavefront
/
taskflow.cpp
Copy path
File metadata and controls
42 lines (32 loc) · 977 Bytes
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
#
include
"
matrix.hpp
"
#
include
<
taskflow/taskflow.hpp
>
//
wavefront computing
void
wavefront_taskflow
(
unsigned
num_threads) {
tf::Executor
executor
(num_threads);
tf::Taskflow taskflow;
std::vector<std::vector<tf::Task>>
node
(
MB
);
for
(
auto
&n : node){
for
(
int
i=
0
; i<
NB
; i++){
n.
emplace_back
(taskflow.
placeholder
());
}
}
matrix[M-
1
][N-
1
] =
0
;
for
(
int
i=
MB
; --i>=
0
; ) {
for
(
int
j=
NB
; --j>=
0
; ) {
node[i][j].
work
(
[=]() {
block_computation
(i, j);
}
);
if
(j+
1
<
NB
) node[i][j].
precede
(node[i][j+
1
]);
if
(i+
1
<
MB
) node[i][j].
precede
(node[i+
1
][j]);
}
}
executor.
run
(taskflow).
get
();
}
std::chrono::microseconds
measure_time_taskflow
(
unsigned
num_threads) {
auto
beg =
std::chrono::high_resolution_clock::now
();
wavefront_taskflow
(num_threads);
auto
end =
std::chrono::high_resolution_clock::now
();
return
std::chrono::duration_cast<std::chrono::microseconds>(end - beg);
}
Back
|
FazBrowse Home
|
New Git URL