Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change itertimes in iterate to print in scientific format for high precision. #248

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gibbon-compiler/src/Gibbon/Passes/Codegen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ codegenTail venv fenv sort_fns (LetTimedT flg bnds rhs body) ty sync_deps =
gib_ptr_bumpalloc_restore_state();
} |]
, C.BlockDecl [cdecl| double $id:itertime = gib_difftimespecs(&$(cid (toVar begn)), &$(cid (toVar end))); |]
, C.BlockStm [cstm| printf("itertime: %lf\n", $id:itertime); |]
, C.BlockStm [cstm| printf("itertime: %e\n", $id:itertime); |]
, C.BlockStm [cstm| gib_vector_inplace_update($id:times, $id:iters, &($id:itertime)); |]
]
in [ C.BlockStm [cstm| for (long long $id:iters = 0; $id:iters < gib_get_iters_param(); $id:iters ++) { $items:body } |]
Expand Down
4 changes: 2 additions & 2 deletions gibbon-rts/rts-c/gibbon_rts.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,10 +677,10 @@ void gib_print_timing_array(GibVector *times) {
for(GibInt i = 0; i < n; i++) {
d = gib_vector_nth(times, i);
if (i == (n-1)) {
printf("%f",*d);
printf("%e",*d);
}
else {
printf("%f, ",*d);
printf("%e, ",*d);
}
}
printf("]\n");
Expand Down
Loading