-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mir-group/master
Pulling master into my dev branch
- Loading branch information
Showing
24 changed files
with
1,284 additions
and
523 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# make library | ||
add_executable(par_test par_test.cpp) | ||
|
||
find_package(OpenMP REQUIRED) | ||
target_link_libraries(par_test PRIVATE OpenMP::OpenMP_CXX) | ||
|
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <iostream> | ||
#include <thread> | ||
#include <chrono> | ||
#include <vector> | ||
#include <Eigen/Dense> | ||
|
||
int main(){ | ||
auto t1 = std::chrono::high_resolution_clock::now(); | ||
|
||
int mat_size = 5; | ||
Eigen::MatrixXd kern_mat = Eigen::MatrixXd::Zero(mat_size, mat_size); | ||
Eigen::VectorXd vec_curr(5); | ||
|
||
#pragma omp parallel for | ||
for (int i = 0; i < mat_size; i ++){ | ||
std::this_thread::sleep_for(std::chrono::seconds(1)); | ||
vec_curr << i, i+1, i+2, i+3, i+4; | ||
kern_mat.col(i) = vec_curr; | ||
} | ||
|
||
auto t2 = std::chrono::high_resolution_clock::now(); | ||
auto tot_time = | ||
std::chrono::duration_cast<std::chrono::milliseconds>(t2-t1).count(); | ||
std::cout << tot_time << std::endl; | ||
std::cout << kern_mat << std::endl; | ||
|
||
} |
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
Oops, something went wrong.