Closed muellch closed 4 years ago
Branching is needed for most advection stencils, since the form of the stencil depends on the sign of the velocity.
The most flexible way to implement if's seems to be to use the following mlir feature:
%x, %y = loop.if %b -> (f32, f32) { %x_true = ... %y_true = ... loop.yield %x_true, %y_true : f32, f32 } else { %x_false = ... %y_false = ... loop.yield %x_false, %y_false : f32, f32 }
We have to test if any of the stencil compiler's passes fail if this feature is used (ShapeInference is a good candidate).
Branching is needed for most advection stencils, since the form of the stencil depends on the sign of the velocity.
The most flexible way to implement if's seems to be to use the following mlir feature:
We have to test if any of the stencil compiler's passes fail if this feature is used (ShapeInference is a good candidate).