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

Trying to fix illegal access

parent cfbda95f
No related branches found
No related tags found
No related merge requests found
...@@ -27,9 +27,11 @@ void init_chunk_board(chunk_info_t *ci) { ...@@ -27,9 +27,11 @@ void init_chunk_board(chunk_info_t *ci) {
void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_context *fc, chunk_info_t *ci) { void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_context *fc, chunk_info_t *ci) {
envelope_t outer_envelope = get_outer_envelope(dc, fc, 1); envelope_t outer_envelope = get_outer_envelope(dc, fc, 1);
struct futhark_i8_2d *fut_north = futhark_new_i8_2d(fc, outer_envelope.north.data, struct futhark_i8_2d *fut_north = futhark_new_i8_2d(fc, outer_envelope.north.data,
outer_envelope.north.dimensions[0], outer_envelope.north.dimensions[0],
outer_envelope.north.dimensions[1]); outer_envelope.north.dimensions[1]);
struct futhark_i8_2d *fut_north_east = futhark_new_i8_2d(fc, outer_envelope.north_east.data, struct futhark_i8_2d *fut_north_east = futhark_new_i8_2d(fc, outer_envelope.north_east.data,
outer_envelope.north_east.dimensions[0], outer_envelope.north_east.dimensions[0],
outer_envelope.north_east.dimensions[1]); outer_envelope.north_east.dimensions[1]);
...@@ -41,6 +43,7 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex ...@@ -41,6 +43,7 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
struct futhark_i8_2d *fut_south_east = futhark_new_i8_2d(fc, outer_envelope.south_east.data, struct futhark_i8_2d *fut_south_east = futhark_new_i8_2d(fc, outer_envelope.south_east.data,
outer_envelope.south_east.dimensions[0], outer_envelope.south_east.dimensions[0],
outer_envelope.south_east.dimensions[1]); outer_envelope.south_east.dimensions[1]);
struct futhark_i8_2d *fut_south = futhark_new_i8_2d(fc, outer_envelope.south.data, struct futhark_i8_2d *fut_south = futhark_new_i8_2d(fc, outer_envelope.south.data,
outer_envelope.south.dimensions[0], outer_envelope.south.dimensions[0],
outer_envelope.south.dimensions[1]); outer_envelope.south.dimensions[1]);
...@@ -58,15 +61,17 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex ...@@ -58,15 +61,17 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
outer_envelope.north_west.dimensions[1]); 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_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; 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, 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); 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_context_sync(fc);
futhark_free_i8_2d(fc, fut_next_chunk_board);
futhark_free_i8_2d(fc, fut_chunk_board); futhark_free_i8_2d(fc, fut_chunk_board);
futhark_free_i8_2d(fc, fut_north_west); futhark_free_i8_2d(fc, fut_north_west);
futhark_free_i8_2d(fc, fut_north); futhark_free_i8_2d(fc, fut_north);
...@@ -76,10 +81,7 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex ...@@ -76,10 +81,7 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
futhark_free_i8_2d(fc, fut_south_west); futhark_free_i8_2d(fc, fut_south_west);
futhark_free_i8_2d(fc, fut_south); futhark_free_i8_2d(fc, fut_south);
futhark_free_i8_2d(fc, fut_south_east); 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[]) { int main(int argc, char *argv[]) {
......
...@@ -29,9 +29,11 @@ void init_chunk_board(chunk_info_t *ci) { ...@@ -29,9 +29,11 @@ void init_chunk_board(chunk_info_t *ci) {
void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_context *fc, chunk_info_t *ci) { void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_context *fc, chunk_info_t *ci) {
envelope_t outer_envelope = get_outer_envelope(dc, fc, 1); envelope_t outer_envelope = get_outer_envelope(dc, fc, 1);
struct futhark_i8_2d *fut_north = futhark_new_i8_2d(fc, outer_envelope.north.data, struct futhark_i8_2d *fut_north = futhark_new_i8_2d(fc, outer_envelope.north.data,
outer_envelope.north.dimensions[0], outer_envelope.north.dimensions[0],
outer_envelope.north.dimensions[1]); outer_envelope.north.dimensions[1]);
struct futhark_i8_2d *fut_north_east = futhark_new_i8_2d(fc, outer_envelope.north_east.data, struct futhark_i8_2d *fut_north_east = futhark_new_i8_2d(fc, outer_envelope.north_east.data,
outer_envelope.north_east.dimensions[0], outer_envelope.north_east.dimensions[0],
outer_envelope.north_east.dimensions[1]); outer_envelope.north_east.dimensions[1]);
...@@ -43,6 +45,7 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex ...@@ -43,6 +45,7 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
struct futhark_i8_2d *fut_south_east = futhark_new_i8_2d(fc, outer_envelope.south_east.data, struct futhark_i8_2d *fut_south_east = futhark_new_i8_2d(fc, outer_envelope.south_east.data,
outer_envelope.south_east.dimensions[0], outer_envelope.south_east.dimensions[0],
outer_envelope.south_east.dimensions[1]); outer_envelope.south_east.dimensions[1]);
struct futhark_i8_2d *fut_south = futhark_new_i8_2d(fc, outer_envelope.south.data, struct futhark_i8_2d *fut_south = futhark_new_i8_2d(fc, outer_envelope.south.data,
outer_envelope.south.dimensions[0], outer_envelope.south.dimensions[0],
outer_envelope.south.dimensions[1]); outer_envelope.south.dimensions[1]);
...@@ -60,15 +63,17 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex ...@@ -60,15 +63,17 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
outer_envelope.north_west.dimensions[1]); 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_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; 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, 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); 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_context_sync(fc);
futhark_free_i8_2d(fc, fut_next_chunk_board);
futhark_free_i8_2d(fc, fut_chunk_board); futhark_free_i8_2d(fc, fut_chunk_board);
futhark_free_i8_2d(fc, fut_north_west); futhark_free_i8_2d(fc, fut_north_west);
futhark_free_i8_2d(fc, fut_north); futhark_free_i8_2d(fc, fut_north);
...@@ -78,14 +83,11 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex ...@@ -78,14 +83,11 @@ void compute_next_chunk_board(struct dispatch_context *dc, struct futhark_contex
futhark_free_i8_2d(fc, fut_south_west); futhark_free_i8_2d(fc, fut_south_west);
futhark_free_i8_2d(fc, fut_south); futhark_free_i8_2d(fc, fut_south);
futhark_free_i8_2d(fc, fut_south_east); 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[]) { int main(int argc, char *argv[]) {
if(argc < 3) { if (argc < 3) {
printf("usage: mpirun -n <nb_proc> %s <height> <width>\n", argv[0]); printf("usage: mpirun -n <nb_proc> %s <height> <width>\n", argv[0]);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
......
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