diff --git a/tests/test_vectorization_specific.py b/tests/test_vectorization_specific.py index f4f6c0c7d0a64a375f39ff2365536abbad8f19b5..57c5311bfc5d3e2a72ed1cb93c46dd847c0ad1ab 100644 --- a/tests/test_vectorization_specific.py +++ b/tests/test_vectorization_specific.py @@ -292,6 +292,22 @@ def test_div_and_unevaluated_expr(dtype, instruction_set): assert 'pow' not in code +@pytest.mark.parametrize('dtype', ('float32', 'float64')) +@pytest.mark.parametrize('instruction_set', ('sve', 'sve2', 'sme', 'rvv')) +def test_check_ast_parameters(dtype, instruction_set): + f, g = ps.fields(f"f, g: {dtype}[3D]", layout='fzyx') + + update_rule = [ps.Assignment(g.center(), 2 * f.center())] + + config = pystencils.config.CreateKernelConfig(data_type=dtype, + cpu_vectorize_info={'instruction_set': instruction_set}) + ast = ps.create_kernel(update_rule, config=config) + ast_symbols = [p.symbol for p in ast.get_parameters()] + assert ast.instruction_set['width'] not in ast_symbols + assert ast.instruction_set['intwidth'] not in ast_symbols + + + # TODO this test case needs a complete rework of the vectoriser. The reason is that the vectoriser does not # TODO vectorise symbols at the moment because they could be strides or field sizes, thus involved in pointer arithmetic # TODO This means that the vectoriser only works if fields are involved on the rhs.