Skip to content

Commit 5126819

Browse files
author
twhuang
committed
Merge branch 'dev'
2 parents d70f929 + 58ef71b commit 5126819

573 files changed

Lines changed: 17954 additions & 20649 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/build
1+
/build

benchmarks/data_pipeline/data_pipeline.hpp

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,39 @@
22
#include <string>
33
#include <cassert>
44
#include <thread>
5+
#include <algorithm>
6+
#include <cmath>
7+
#include <vector>
58

6-
inline void work() {
7-
// std::this_thread::sleep_for(std::chrono::microseconds(10));
9+
// inline void work() {
10+
// std::this_thread::sleep_for(std::chrono::microseconds(10));
11+
// }
12+
13+
inline void work_int(int& input) {
14+
for (int i = 0; i < 100; i++) {
15+
input = cos(input) * input + 1;
16+
input = (int)std::pow(input, 5) % 2147483647;
17+
}
18+
}
19+
20+
inline void work_vector(std::vector<int>& input) {
21+
for (int i = 0; i < 100; i++) {
22+
input[0] = cos(input[0]) * input[0] + 1;
23+
input[0] = (int)std::pow(input[0], 5) % 2147483647;
24+
}
25+
}
26+
27+
inline void work_float(float& input) {
28+
for (int i = 0; i < 100; i++) {
29+
input = cos(input) * input + 1;
30+
input = std::pow(input, 4);
31+
}
32+
}
33+
34+
inline void work_string(std::string& input) {
35+
for (int i = 0; i < 50; i++) {
36+
input = std::to_string(std::stoi(input) + 1);
37+
}
838
}
939

1040
std::chrono::microseconds measure_time_taskflow(std::string, unsigned, unsigned, size_t);

benchmarks/data_pipeline/main.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,5 @@ int main(int argc, char* argv[]) {
7171
std::cout << std::setw(12) << L
7272
<< std::setw(12) << runtime / num_rounds / 1e3
7373
<< std::endl;
74-
75-
/*if (model == "tf") {
76-
std::ofstream outputfile;
77-
outputfile.open("./tf_time.csv", std::ofstream::app);
78-
outputfile << num_threads << ','
79-
<< num_lines << ','
80-
<< pipes << ','
81-
<< L << ','
82-
<< runtime / num_rounds / 1e3 << '\n';
83-
84-
outputfile.close();
85-
}
86-
else if (model == "tbb") {
87-
std::ofstream outputfile;
88-
outputfile.open("./tbb_time.csv", std::ofstream::app);
89-
outputfile << num_threads << ','
90-
<< num_lines << ','
91-
<< pipes << ','
92-
<< L << ','
93-
<< runtime / num_rounds / 1e3 << '\n';
94-
95-
outputfile.close();
96-
}*/
9774
}
9875
}

0 commit comments

Comments
 (0)