Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][ESIMD] Fix Stencil test result mismatch with large input. #148

Merged
merged 1 commit into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions SYCL/ESIMD/Stencil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// test smaller input size
// test 8x16 block size
//
#define DIM_SIZE (1 << 10)
#define DIM_SIZE (1 << 13)
#define SQUARE_SZ (DIM_SIZE * DIM_SIZE)

#define WIDTH 16
Expand Down Expand Up @@ -145,11 +145,6 @@ int main(void) {
in.row(i + 2).select<WIDTH, 1>(5) * -0.0333333333333f +
in.row(i + 3).select<WIDTH, 1>(5) * -0.05f +
in.row(i + 4).select<WIDTH, 1>(5) * -0.1f +
in.row(i + 6).select<WIDTH, 1>(5) * 0.1f +
in.row(i + 7).select<WIDTH, 1>(5) * 0.05f +
in.row(i + 8).select<WIDTH, 1>(5) * 0.0333333333333f +
in.row(i + 9).select<WIDTH, 1>(5) * 0.025f +
in.row(i + 10).select<WIDTH, 1>(5) * 0.02f +
in.row(i + 5).select<WIDTH, 1>(0) * -0.02f +
in.row(i + 5).select<WIDTH, 1>(1) * -0.025f +
in.row(i + 5).select<WIDTH, 1>(2) * -0.0333333333333f +
Expand All @@ -159,7 +154,12 @@ int main(void) {
in.row(i + 5).select<WIDTH, 1>(7) * 0.05f +
in.row(i + 5).select<WIDTH, 1>(8) * 0.0333333333333f +
in.row(i + 5).select<WIDTH, 1>(9) * 0.025f +
in.row(i + 5).select<WIDTH, 1>(10) * 0.02f;
in.row(i + 5).select<WIDTH, 1>(10) * 0.02f +
in.row(i + 6).select<WIDTH, 1>(5) * 0.1f +
in.row(i + 7).select<WIDTH, 1>(5) * 0.05f +
in.row(i + 8).select<WIDTH, 1>(5) * 0.0333333333333f +
in.row(i + 9).select<WIDTH, 1>(5) * 0.025f +
in.row(i + 10).select<WIDTH, 1>(5) * 0.02f;

// predciate output
simd<ushort, WIDTH> p = (elm16 + h_pos * WIDTH) < DIM_SIZE - 10;
Expand Down
14 changes: 7 additions & 7 deletions SYCL/ESIMD/stencil2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// test smaller input size
// test 8x16 block size
//
#define DIM_SIZE (1 << 10)
#define DIM_SIZE (1 << 13)
#define SQUARE_SZ (DIM_SIZE * DIM_SIZE)

#define WIDTH 16
Expand Down Expand Up @@ -147,11 +147,6 @@ int main(void) {
vin.select<WIDTH, 1>(GET_IDX(i + 2, 5)) * -0.0333333333333f +
vin.select<WIDTH, 1>(GET_IDX(i + 3, 5)) * -0.05f +
vin.select<WIDTH, 1>(GET_IDX(i + 4, 5)) * -0.1f +
vin.select<WIDTH, 1>(GET_IDX(i + 6, 5)) * 0.1f +
vin.select<WIDTH, 1>(GET_IDX(i + 7, 5)) * 0.05f +
vin.select<WIDTH, 1>(GET_IDX(i + 8, 5)) * 0.0333333333333f +
vin.select<WIDTH, 1>(GET_IDX(i + 9, 5)) * 0.025f +
vin.select<WIDTH, 1>(GET_IDX(i + 10, 5)) * 0.02f +
vin.select<WIDTH, 1>(GET_IDX(i + 5, 0)) * -0.02f +
vin.select<WIDTH, 1>(GET_IDX(i + 5, 1)) * -0.025f +
vin.select<WIDTH, 1>(GET_IDX(i + 5, 2)) * -0.0333333333333f +
Expand All @@ -161,7 +156,12 @@ int main(void) {
vin.select<WIDTH, 1>(GET_IDX(i + 5, 7)) * 0.05f +
vin.select<WIDTH, 1>(GET_IDX(i + 5, 8)) * 0.0333333333333f +
vin.select<WIDTH, 1>(GET_IDX(i + 5, 9)) * 0.025f +
vin.select<WIDTH, 1>(GET_IDX(i + 5, 10)) * 0.02f;
vin.select<WIDTH, 1>(GET_IDX(i + 5, 10)) * 0.02f +
vin.select<WIDTH, 1>(GET_IDX(i + 6, 5)) * 0.1f +
vin.select<WIDTH, 1>(GET_IDX(i + 7, 5)) * 0.05f +
vin.select<WIDTH, 1>(GET_IDX(i + 8, 5)) * 0.0333333333333f +
vin.select<WIDTH, 1>(GET_IDX(i + 9, 5)) * 0.025f +
vin.select<WIDTH, 1>(GET_IDX(i + 10, 5)) * 0.02f;

// predciate output
simd<ushort, WIDTH> p = (elm16 + h_pos * WIDTH) < DIM_SIZE - 10;
Expand Down