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

Fixed order

parent 5a13d0e1
No related branches found
No related tags found
No related merge requests found
......@@ -231,8 +231,8 @@ static envelope_t get_inner_envelope_2d(struct dispatch_context *dc, struct futh
int thickness_x = min(thickness, dc->chunk_info->dimensions[1]);
futhark_context_sync(fc);
futhark_entry_get_envelope_2d(fc, &fut_north, &fut_north_east, &fut_east, &fut_south_east, &fut_south,
&fut_south_west, &fut_west, &fut_north_west, fut_chunk_data, thickness_y,
futhark_entry_get_envelope_2d(fc, &fut_north_west, &fut_north, &fut_north_east, &fut_west, &fut_east,
&fut_south_west, &fut_south, &fut_south_east, fut_chunk_data, thickness_y,
thickness_x * dc->type);
futhark_context_sync(fc);
futhark_free_u8_2d(fc, fut_chunk_data);
......
let get_envelope_1d [n] (xs: [n]u8) (thickness: i64) : ([]u8, []u8) =
-- type envelope_1d_t [n] = {
-- west: [n]u8,
-- east: [n]u8
-- }
--
-- type envelope_2d_t [n][m][ty][tx] = {
-- north_west: [ty][tx]u8,
-- north: [ty][m]u8,
-- north_east: [ty][tx]u8,
-- west: [n][tx]u8,
-- east: [n][tx]u8,
-- south_west: [ty][tx]u8,
-- south: [ty][m]u8,
-- south_east: [ty][tx]u8
-- }
entry get_envelope_1d [n] (xs: [n]u8) (thickness: i64) : ([]u8, []u8) =
let west = xs[0:thickness] :> [thickness]u8
let east = xs[n - thickness:] :> [thickness]u8
in (west, east)
let get_envelope_2d [n][m] (matrix: [n][m]u8) (thickness_y: i64) (thickness_x: i64): ([][]u8, [][]u8, [][]u8, [][]u8, [][]u8, [][]u8, [][]u8, [][]u8) =
entry get_envelope_2d [n][m] (matrix: [n][m]u8) (thickness_y: i64) (thickness_x: i64): ([][]u8, [][]u8, [][]u8, [][]u8, [][]u8, [][]u8, [][]u8, [][]u8) =
let north = matrix[0:thickness_y] :> [thickness_y][m]u8
let north_west = matrix[0:thickness_y,0:thickness_x] :> [thickness_y][thickness_x]u8
......@@ -17,4 +33,4 @@ let get_envelope_2d [n][m] (matrix: [n][m]u8) (thickness_y: i64) (thickness_x: i
let east = matrix[:,m - (thickness_x):] :> [n][thickness_x]u8
let west = matrix[:,0:thickness_x] :> [n][thickness_x]u8
in (north, north_east, east, south_east, south, south_west, west, north_west)
in (north_west, north, north_east, west, east, south_west, south, south_east)
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