-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Committer: Weile Wei <[email protected]>
- Loading branch information
Showing
8 changed files
with
128 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,54 @@ | ||
#include <commons.hpp> | ||
|
||
#include <hpx/hpx_main.hpp> | ||
#include <hpx/iostream.hpp> | ||
#include <hpx/algorithm.hpp> | ||
#include <hpx/execution.hpp> | ||
|
||
void runTaskSize(const long long length){ | ||
#include <hpx/hpx_main.hpp> | ||
#include <hpx/iostream.hpp> | ||
|
||
void runTaskSize(const long long length) { | ||
std::vector<double> workVec(length); | ||
for (size_t i =0; i < length; ++i) { | ||
for (size_t i = 0; i < length; ++i) { | ||
workVec[i] = uni(rng); | ||
} | ||
|
||
getExecutionTime("transform hpx::execution::seq", [workVec]() mutable { | ||
hpx::transform(hpx::execution::seq, workVec.begin(), workVec.end(), | ||
workVec.begin(), | ||
[](double arg){ return std::tan(arg); } | ||
); | ||
}); | ||
|
||
workVec.begin(), [](double arg) { return std::tan(arg); }); | ||
}); | ||
|
||
getExecutionTime("transform hpx::execution::par", [workVec]() mutable { | ||
hpx::transform(hpx::execution::par, workVec.begin(), workVec.end(), | ||
workVec.begin(), | ||
[](double arg){ return std::tan(arg); } | ||
); | ||
workVec.begin(), [](double arg) { return std::tan(arg); }); | ||
}); | ||
|
||
getExecutionTime("transform hpx::execution::par_unseq", [workVec]() mutable { | ||
hpx::transform(hpx::execution::par_unseq, workVec.begin(), workVec.end(), | ||
workVec.begin(), | ||
[](double arg){ return std::tan(arg); } | ||
); | ||
workVec.begin(), [](double arg) { return std::tan(arg); }); | ||
}); | ||
|
||
getExecutionTime("sort hpx::execution::seq", [workVec]() mutable { | ||
hpx::sort(hpx::execution::seq, workVec.begin(), workVec.end()); | ||
}); | ||
getExecutionTime("sort hpx ::execution::par", [workVec]() mutable { | ||
|
||
getExecutionTime("sort hpx ::execution::par", [workVec]() mutable { | ||
hpx::sort(hpx::execution::par, workVec.begin(), workVec.end()); | ||
}); | ||
|
||
getExecutionTime("sort hpx::execution::par_unseq", [workVec]() mutable { | ||
hpx::sort(hpx::execution::par_unseq, workVec.begin(), workVec.end()); | ||
hpx::sort(hpx::execution::par_unseq, workVec.begin(), workVec.end()); | ||
}); | ||
|
||
std::cout << '\n'; | ||
} | ||
|
||
int main(int argc, char** argv){ | ||
int main(int argc, char **argv) { | ||
long long length; | ||
|
||
char *a = argv[1]; | ||
length = atoll(a); | ||
|
||
std::cout << "running experiment with size of " + std::to_string(length) << "\n"; | ||
std::cout << "running experiment with size of " + std::to_string(length) | ||
<< "\n"; | ||
|
||
runTaskSize(length); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.