Skip to content
Snippets Groups Projects
Verified Commit e97c08cc authored by baptiste.coudray's avatar baptiste.coudray
Browse files

Updated bench

parent e883dd7c
No related branches found
No related tags found
No related merge requests found
......@@ -30,11 +30,9 @@ void init_chunk_elems(chunk_info_t *ci) {
}
double compute_next_chunk_elems(struct dispatch_context *dc, struct futhark_context *fc, chunk_info_t *ci) {
double start0 = MPI_Wtime();
double start = MPI_Wtime();
struct futhark_i8_1d *fut_chunk_with_envelope = get_chunk_with_envelope(dc, fc, 1, futhark_new_i8_1d);
double finish0 = MPI_Wtime();
double start1 = MPI_Wtime();
struct futhark_i8_1d *fut_next_chunk_elems;
for (int i = 0; i < N_ITERATIONS; ++i) {
futhark_entry_next_chunk_elems(fc, &fut_next_chunk_elems, fut_chunk_with_envelope);
......@@ -43,10 +41,10 @@ double compute_next_chunk_elems(struct dispatch_context *dc, struct futhark_cont
}
futhark_values_i8_1d(fc, fut_next_chunk_elems, ci->data);
futhark_context_sync(fc);
double finish1 = MPI_Wtime();
double finish = MPI_Wtime();
futhark_free_i8_1d(fc, fut_chunk_with_envelope);
return (finish0 - start0) + (finish1 - start1);
return finish - start;
}
int main(int argc, char *argv[]) {
......
......@@ -34,11 +34,9 @@ void init_chunk_board(chunk_info_t *ci) {
}
double compute_next_chunk_board(struct dispatch_context *dc, struct futhark_context *fc, chunk_info_t *ci) {
double start0 = MPI_Wtime();
double start = MPI_Wtime();
struct futhark_i8_2d *fut_chunk_with_envelope = get_chunk_with_envelope(dc, fc, 1, futhark_new_i8_2d);
double finish0 = MPI_Wtime();
double start1 = MPI_Wtime();
struct futhark_i8_2d *fut_next_chunk_board;
for (int i = 0; i < N_ITERATIONS; ++i) {
futhark_entry_next_chunk_board(fc, &fut_next_chunk_board, fut_chunk_with_envelope);
......@@ -47,10 +45,10 @@ double compute_next_chunk_board(struct dispatch_context *dc, struct futhark_cont
}
futhark_values_i8_2d(fc, fut_next_chunk_board, ci->data);
futhark_context_sync(fc);
double finish1 = MPI_Wtime();
double finish = MPI_Wtime();
futhark_free_i8_2d(fc, fut_chunk_with_envelope);
return (finish0 - start0) + (finish1 - start1);
return finish - start;
}
int main(int argc, char *argv[]) {
......
......@@ -42,11 +42,9 @@ convert_chunk_with_envelope(struct futhark_context *fc, const void *data, int64_
}
double compute_next_lbm(struct dispatch_context *dc, struct futhark_context *fc, chunk_info_t *ci) {
double start0 = MPI_Wtime();
double start = MPI_Wtime();
struct futhark_f32_4d *fut_chunk_with_envelope = get_chunk_with_envelope(dc, fc, 1, convert_chunk_with_envelope);
double finish0 = MPI_Wtime();
double start1 = MPI_Wtime();
struct futhark_f32_4d *fut_next_chunk_lbm;
for (int i = 0; i < N_ITERATIONS; ++i) {
futhark_entry_next_chunk_lbm(fc, &fut_next_chunk_lbm, fut_chunk_with_envelope);
......@@ -55,10 +53,10 @@ double compute_next_lbm(struct dispatch_context *dc, struct futhark_context *fc,
}
futhark_values_f32_4d(fc, fut_next_chunk_lbm, ci->data);
futhark_context_sync(fc);
double finish1 = MPI_Wtime();
double finish = MPI_Wtime();
futhark_free_f32_4d(fc, fut_chunk_with_envelope);
return (finish0 - start0) + (finish1 - start1);
return finish - start;
}
int main(int argc, char *argv[]) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment