From 8e795454c9c15df845080731ad507c70a7017232 Mon Sep 17 00:00:00 2001 From: Markus Holzer <markus.holzer@fau.de> Date: Fri, 27 Sep 2024 12:14:26 +0200 Subject: [PATCH] Add specific test case --- tests/test_vectorization_specific.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_vectorization_specific.py b/tests/test_vectorization_specific.py index f4f6c0c7d..57c5311bf 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. -- GitLab