Guest User

mt_benchmark_no_alloc_bias

a guest
Mar 5th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.59 KB | None | 0 0
  1.     double level_set_value = .5;
  2.  
  3.     int NRUNS = 10;
  4.  
  5.     Eigen::MatrixXd isoV1;
  6.     Eigen::MatrixXi isoF1;
  7.     auto start_sort = std::chrono::high_resolution_clock::now();
  8.     for (int i = 0; i < NRUNS; i++) {
  9.         igl::marching_tets(TV, TT, isovalues, level_set_value, isoV1, isoF1);
  10.     }
  11.     auto finish_sort = std::chrono::high_resolution_clock::now();
  12.     std::chrono::duration<double> elapsed_sort = finish_sort - start_sort;
  13.     std::cout << "MT with SORT took (average over " << NRUNS << " runs) " << elapsed_sort.count()/ NRUNS << "s" << std::endl;
  14.  
  15.     Eigen::MatrixXd isoV2;
  16.     Eigen::MatrixXi isoF2;
  17.     auto start_hash = std::chrono::high_resolution_clock::now();
  18.     for (int i = 0; i < NRUNS; i++) {
  19.         igl::marching_tets_2(TV, TT, isovalues, level_set_value, isoV2, isoF2);
  20.     }
  21.     auto finish_hash = std::chrono::high_resolution_clock::now();
  22.     std::chrono::duration<double> elapsed_hash = finish_hash - start_hash;
  23.     std::cout << "MT with HASH took (average over " << NRUNS << " runs) " << elapsed_hash.count() / NRUNS << "s" << std::endl;
  24.  
  25.     Eigen::MatrixXd isoV3;
  26.     Eigen::MatrixXi isoF3;
  27.     auto start_hash2 = std::chrono::high_resolution_clock::now();
  28.     for (int i = 0; i < NRUNS; i++) {
  29.         igl::marching_tets_3(TV, TT, isovalues, level_set_value, isoV3, isoF3);
  30.     }
  31.     auto finish_hash2 = std::chrono::high_resolution_clock::now();
  32.     std::chrono::duration<double> elapsed_hash2 = finish_hash2 - start_hash2;
  33.     std::cout << "MT with HASH2 took (average over " << NRUNS << " runs) " << elapsed_hash2.count() / NRUNS << "s" << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment