Skip to content

Commit

Permalink
changes in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
iakoviid committed Sep 12, 2022
1 parent 3e1fd1f commit 1aa3f0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 6 additions & 3 deletions examples/crhmc_sampling/crhmc_sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
template <typename NT, int simdLen = 1>
void run_main(int n_samples = 10000, int n_burns = -1, int dimension = 2,
int walk_length = 1, int burn_steps = 1) {
std::cerr << "Using simdLe n= " << simdLen << "\n";
std::cerr << "Using simdLen= " << simdLen << "\n";
using Kernel = Cartesian<NT>;
using Point = typename Kernel::Point;
using pts = std::vector<Point>;
Expand Down Expand Up @@ -144,13 +144,16 @@ int main(int argc, char *argv[]) {
run_main<double>(atoi(argv[1]), atoi(argv[2]), atoi(argv[3]),
atoi(argv[4]));
} else if (argc == 6) {
run_main<double>(atoi(argv[1]), atoi(argv[2]), atoi(argv[3]), atoi(argv[4]),
atoi(argv[5]));
} else if (argc == 7) {
int simdLen = atoi(argv[5]);
if (simdLen == 1) {
run_main<double, 1>(atoi(argv[1]), atoi(argv[2]), atoi(argv[3]),
atoi(argv[4]));
atoi(argv[4]), atoi(argv[5]));
} else if (simdLen == 4) {
run_main<double, 4>(atoi(argv[1]), atoi(argv[2]), atoi(argv[3]),
atoi(argv[4]));
atoi(argv[4]), atoi(argv[5]));
}
}
return 0;
Expand Down
7 changes: 3 additions & 4 deletions test/benchmarks_crhmc_sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,14 @@ std::vector<SimulationStats<NT>> benchmark_polytope_sampling(StreamType &stream,

ETA = (NT)std::chrono::duration_cast<std::chrono::microseconds>(stop - start)
.count();

std::cout << std::endl;
#ifdef TIME_KEEPING
std::chrono::duration<double> total_time = stop - start;
stream << "Total time: " << total_time.count() << "\n";
assert(total_time.count() < target_time);
stream << "Assertion (preparation_time< " << target_time
<< " secs) passed!" << std::endl
<< std::endl;
<< " secs) passed!" << std::endl
<< std::endl;
#ifdef TIME_KEEPING
crhmc.print_timing_information(stream);
#endif
print_diagnostics<NT, VT, MT>(samples, min_ess, std::cout);
Expand Down

0 comments on commit 1aa3f0d

Please sign in to comment.