Revamp the type system
@bauer had planned to do that before he left, but ran out of time. He has some pretty clear ideas of how the type system should be. It should probably be done relatively quickly as it would make quite a few things a lot easier, e.g. the SIMD stuff. It is also necessary before things like #12 (closed) can be done properly.
The following test (for test_vectorization.py) does not work currently:
def test_vectorized_loop_counter():
arr = np.zeros((4, 4))
@ps.kernel
def kernel_equal(s):
f = ps.fields(f=arr)
f[0, 0] @= ps.astnodes.LoopOverCoordinate.get_loop_counter_symbol(1)
ast = ps.create_kernel(kernel_equal).compile()(f=arr)
arr_ref = arr.copy()
arr = np.zeros((4, 4))
vectorize(ast, instruction_set=instruction_set)
ps.show_code(ast)
ast.compile()(f=arr)
assert np.allclose(arr_ref, arr)
Another problem can be found in the attached jupyter notebook, where in the absence of type_all_numbers
floating-point comparisons are used for integers in a conditional.
Finally, automatic conversion of arguments to the type expected by the signature of the SIMD intrinsics is not supported, which made walberla/walberla!414 (diffs) necessary.
Edited by Michael Kuron