When inlining, a LBOUND(current, dim=1) expression (given explicit in the code) is turned into LBOUND(current(:,:), dim=1). The latter is wrong if current does not have '1' as lower bound (since the latter expression will always return 1, even if current is e.g. (0:11, 0:11)).
When additional lbound statements added by PSyclone, they work as expected, e.g.:
neighbours(i - 1 + LBOUND(neighbours, dim=1),j - 1 + LBOUND(neighbours, dim=2)) = current(i - 1 - 1 + LBOUND(current, &
&dim=1),j - 1 - 1 + LBOUND(current, dim=2)) + current(i - 1 + LBOUND(current, dim=1),j - 1 - 1 + LBOUND(current, dim=2)) + &
For now, an example is here:
https://github.com/stfc/PSyclone/tree/1623_add_training/tutorial/training/transformation/3.4-tiling/solution
Just run make.
In the FortranWriter, I see that the statements inserted by PSyclone (I assume by the inline transformation?) has a Reference as parameter, while the lbound from the inlined function has an ArrayReference (with a Range, which is then turned into (:,:).
Not sure exactly what is wrong tbh.
When inlining, a
LBOUND(current, dim=1)expression (given explicit in the code) is turned intoLBOUND(current(:,:), dim=1). The latter is wrong ifcurrentdoes not have '1' as lower bound (since the latter expression will always return 1, even ifcurrentis e.g.(0:11, 0:11)).When additional
lboundstatements added by PSyclone, they work as expected, e.g.:For now, an example is here:
https://github.com/stfc/PSyclone/tree/1623_add_training/tutorial/training/transformation/3.4-tiling/solution
Just run
make.In the FortranWriter, I see that the statements inserted by PSyclone (I assume by the inline transformation?) has a
Referenceas parameter, while thelboundfrom the inlined function has anArrayReference(with aRange, which is then turned into(:,:).Not sure exactly what is wrong tbh.