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

Fixed illegal access

parent 2f1c1e5f
No related branches found
No related tags found
No related merge requests found
......@@ -199,6 +199,7 @@ static envelope_t get_inner_envelope_1d(struct dispatch_context *dc, struct futh
chunk_info_init(&inner_envelope.west, dc->type, dimensions, 0, start_x, true);
futhark_values_u8_1d(fc, fut_west, inner_envelope.west.data);
}
// East
{
int start_x = dc->chunk_info->x + dc->chunk_info->dimensions[1] - thickness_x;
......@@ -583,7 +584,6 @@ extern envelope_t get_outer_envelope(struct dispatch_context *dc, struct futhark
MPI_Abort(MPI_COMM_WORLD, 1);
break;
}
futhark_context_sync(fc);
envelope_free(&inner_envelope);
return outer_envelope;
}
......
......@@ -57,12 +57,11 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
outer_envelope.north_west.dimensions[0],
outer_envelope.north_west.dimensions[1]);
envelope_free(&outer_envelope);
struct futhark_i8_2d *fut_chunk_board = futhark_new_i8_2d(fc, ci->data, ci->dimensions[0], ci->dimensions[1]);
futhark_context_sync(fc);
envelope_free(&outer_envelope);
struct futhark_i8_2d *fut_next_chunk_board;
futhark_context_sync(fc);
futhark_entry_next_chunk_board(fc, &fut_next_chunk_board, fut_chunk_board, fut_north_west, fut_north,
fut_north_east, fut_west, fut_east, fut_south_west, fut_south, fut_south_east);
......
......@@ -60,16 +60,16 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
outer_envelope.north_west.dimensions[1]);
struct futhark_i8_2d *fut_chunk_board = futhark_new_i8_2d(fc, ci->data, ci->dimensions[0], ci->dimensions[1]);
struct futhark_i8_2d *fut_next_chunk_board;
futhark_context_sync(fc);
envelope_free(&outer_envelope);
struct futhark_i8_2d *fut_next_chunk_board;
futhark_entry_next_chunk_board(fc, &fut_next_chunk_board, fut_chunk_board, fut_north_west, fut_north,
fut_north_east, fut_west, fut_east, fut_south_west, fut_south, fut_south_east);
futhark_context_sync(fc);
futhark_values_i8_2d(fc, fut_next_chunk_board, ci->data);
futhark_context_sync(fc);
futhark_free_i8_2d(fc, fut_chunk_board);
futhark_free_i8_2d(fc, fut_next_chunk_board);
futhark_free_i8_2d(fc, fut_north_west);
futhark_free_i8_2d(fc, fut_north);
futhark_free_i8_2d(fc, fut_north_east);
......@@ -79,7 +79,9 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
futhark_free_i8_2d(fc, fut_south);
futhark_free_i8_2d(fc, fut_south_east);
envelope_free(&outer_envelope);
futhark_values_i8_2d(fc, fut_next_chunk_board, ci->data);
futhark_context_sync(fc);
futhark_free_i8_2d(fc, fut_next_chunk_board);
}
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