Open jdahm opened 5 years ago
This might be the same bug we hit with:
stencil vertical_loop_1 {
storage a;
var b;
Do {
vertical_region(k_start+1, k_end) {
b = a[k-1];
a += b;
}
}
};
stencil vertical_loop_2 {
storage a;
Do {
vertical_region(k_start+1, k_end) {
double b = a[k-1];
a += b;
}
}
};
We expect the same output as with this code:
stencil vertical_loop_3 {
storage a;
Do {
vertical_region(k_start+1, k_end) {
a += a[k-1];
}
}
};
Dawn can currently generate incorrect code for solvers when a field has been versioned. Specifically, this occurs, when there are vertical dependencies in a versioned field. This happens for example with:
The stencil instantiation for this is
Notice that this reads from an uninitialized field
out_0
.PassFixVersionedInputFields
, which adds multistages to initialize versioned fields warns the user when it sees this pattern, but it cannot currently fix it. Adding a multistage to initializeout_0
in this case generates invalid code, so we need another approach to address these cases.