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

Fixed segfault

parent 1463e091
No related branches found
No related tags found
No related merge requests found
...@@ -37,10 +37,13 @@ double compute_next_chunk_elems(struct dispatch_context *dc, struct futhark_cont ...@@ -37,10 +37,13 @@ double compute_next_chunk_elems(struct dispatch_context *dc, struct futhark_cont
for (int i = 0; i < N_ITERATIONS; ++i) { for (int i = 0; i < N_ITERATIONS; ++i) {
futhark_entry_next_chunk_elems(fc, &fut_next_chunk_elems, fut_chunk_with_envelope); futhark_entry_next_chunk_elems(fc, &fut_next_chunk_elems, fut_chunk_with_envelope);
futhark_context_sync(fc); futhark_context_sync(fc);
futhark_free_i8_1d(fc, fut_next_chunk_elems); if (i + 1 < N_ITERATIONS) {
futhark_free_i8_1d(fc, fut_next_chunk_elems);
}
} }
futhark_values_i8_1d(fc, fut_next_chunk_elems, ci->data); futhark_values_i8_1d(fc, fut_next_chunk_elems, ci->data);
futhark_context_sync(fc); futhark_context_sync(fc);
futhark_free_i8_1d(fc, fut_next_chunk_elems);
futhark_free_i8_1d(fc, fut_chunk_with_envelope); futhark_free_i8_1d(fc, fut_chunk_with_envelope);
double finish = MPI_Wtime(); double finish = MPI_Wtime();
......
...@@ -41,10 +41,13 @@ double compute_next_chunk_board(struct dispatch_context *dc, struct futhark_cont ...@@ -41,10 +41,13 @@ double compute_next_chunk_board(struct dispatch_context *dc, struct futhark_cont
for (int i = 0; i < N_ITERATIONS; ++i) { for (int i = 0; i < N_ITERATIONS; ++i) {
futhark_entry_next_chunk_board(fc, &fut_next_chunk_board, fut_chunk_with_envelope); futhark_entry_next_chunk_board(fc, &fut_next_chunk_board, fut_chunk_with_envelope);
futhark_context_sync(fc); futhark_context_sync(fc);
futhark_free_i8_2d(fc, fut_next_chunk_board); if (i + 1 < N_ITERATIONS) {
futhark_free_i8_2d(fc, fut_next_chunk_board);
}
} }
futhark_values_i8_2d(fc, fut_next_chunk_board, ci->data); futhark_values_i8_2d(fc, fut_next_chunk_board, ci->data);
futhark_context_sync(fc); futhark_context_sync(fc);
futhark_free_i8_2d(fc, fut_next_chunk_board);
futhark_free_i8_2d(fc, fut_chunk_with_envelope); futhark_free_i8_2d(fc, fut_chunk_with_envelope);
double finish = MPI_Wtime(); double finish = MPI_Wtime();
......
...@@ -49,10 +49,13 @@ double compute_next_lbm(struct dispatch_context *dc, struct futhark_context *fc, ...@@ -49,10 +49,13 @@ double compute_next_lbm(struct dispatch_context *dc, struct futhark_context *fc,
for (int i = 0; i < N_ITERATIONS; ++i) { for (int i = 0; i < N_ITERATIONS; ++i) {
futhark_entry_next_chunk_lbm(fc, &fut_next_chunk_lbm, fut_chunk_with_envelope); futhark_entry_next_chunk_lbm(fc, &fut_next_chunk_lbm, fut_chunk_with_envelope);
futhark_context_sync(fc); futhark_context_sync(fc);
futhark_free_f32_4d(fc, fut_next_chunk_lbm); if (i + 1 < N_ITERATIONS) {
futhark_free_f32_4d(fc, fut_next_chunk_lbm);
}
} }
futhark_values_f32_4d(fc, fut_next_chunk_lbm, ci->data); futhark_values_f32_4d(fc, fut_next_chunk_lbm, ci->data);
futhark_context_sync(fc); futhark_context_sync(fc);
futhark_free_f32_4d(fc, fut_next_chunk_lbm);
futhark_free_f32_4d(fc, fut_chunk_with_envelope); futhark_free_f32_4d(fc, fut_chunk_with_envelope);
double finish = MPI_Wtime(); double finish = MPI_Wtime();
......
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