Skip to content
Snippets Groups Projects
Commit a7263550 authored by Markus Holzer's avatar Markus Holzer
Browse files

Final changes

parent 8e795454
1 merge request!412[FIX] Vector Size for SVE instruction set is in free kernel parameters
Pipeline #69264 passed with stages
in 33 minutes and 35 seconds
This commit is part of merge request !412. Comments created here will be created in the context of that merge request.
......@@ -113,7 +113,7 @@ def get_vector_instruction_set_arm(data_type='double', instruction_set='neon'):
vindex.format("{1}") + ')'
if instruction_set.startswith('sve2') and instruction_set not in ('sve256', 'sve2048'):
result['streamS'] = f'svstnt1_scatter_u{bits[data_type]}offset_f{bits[data_type]}({predicate}, {{0}}, ' + \
vindex.format(f"{{2}}*{bits[data_type] // 8}") + ', {1})'
vindex.format(f"{{2}}*{bits[data_type]//8}") + ', {1})'
result['+int'] = f"svadd_s{bits['int']}_x({int_predicate}, " + "{0}, {1})"
......
......@@ -34,8 +34,6 @@ def test_vectorisation_varying_arch(instruction_set):
config = pystencils.config.CreateKernelConfig(cpu_vectorize_info={'instruction_set': instruction_set})
ast = ps.create_kernel(update_rule, config=config)
for parameter in ast.get_parameters():
assert not isinstance(parameter.symbol, CFunction)
kernel = ast.compile()
kernel(f=arr)
np.testing.assert_equal(arr, 2)
......@@ -55,8 +53,6 @@ def test_vectorized_abs(instruction_set, dtype):
config = pystencils.config.CreateKernelConfig(cpu_vectorize_info={'instruction_set': instruction_set})
ast = ps.create_kernel(update_rule, config=config)
for parameter in ast.get_parameters():
assert not isinstance(parameter.symbol, CFunction)
func = ast.compile()
dst = np.zeros_like(arr)
......@@ -129,8 +125,6 @@ def test_alignment_and_correct_ghost_layers(gl_field, gl_kernel, instruction_set
config = pystencils.config.CreateKernelConfig(target=dh.default_target,
cpu_vectorize_info=opt, ghost_layers=gl_kernel)
ast = ps.create_kernel(update_rule, config=config)
for parameter in ast.get_parameters():
assert not isinstance(parameter.symbol, CFunction)
kernel = ast.compile()
if ('loadA' in ast.instruction_set or 'storeA' in ast.instruction_set) and gl_kernel != gl_field:
with pytest.raises(ValueError):
......@@ -178,8 +172,6 @@ def test_square_root(dtype, instruction_set, field_layout):
ps.Assignment(sp.Symbol("xi_2"), sp.Symbol("xi") * sp.sqrt(src_field.center))]
ast = ps.create_kernel(eq, config=config)
for parameter in ast.get_parameters():
assert not isinstance(parameter.symbol, CFunction)
ast.compile()
code = ps.get_code_str(ast)
print(code)
......@@ -200,8 +192,6 @@ def test_square_root_2(dtype, instruction_set, padding):
config = ps.CreateKernelConfig(data_type=dtype, default_number_float=dtype, cpu_vectorize_info=cpu_vec)
ast = ps.create_kernel(up, config=config)
for parameter in ast.get_parameters():
assert not isinstance(parameter.symbol, CFunction)
ast.compile()
code = ps.get_code_str(ast)
......@@ -225,8 +215,6 @@ def test_pow(dtype, instruction_set, padding):
ps.Assignment(sp.Symbol("xi_2"), sp.Symbol("xi") * sp.Pow(src_field.center, 0.5))]
ast = ps.create_kernel(eq, config=config)
for parameter in ast.get_parameters():
assert not isinstance(parameter.symbol, CFunction)
ast.compile()
code = ps.get_code_str(ast)
......@@ -254,8 +242,6 @@ def test_issue62(dtype, instruction_set, padding):
cpu_vectorize_info=opt)
ast = ps.create_kernel(up, config=config)
for parameter in ast.get_parameters():
assert not isinstance(parameter.symbol, CFunction)
ast.compile()
code = ps.get_code_str(ast)
......@@ -282,8 +268,6 @@ def test_div_and_unevaluated_expr(dtype, instruction_set):
cpu_vectorize_info=opt)
ast = ps.create_kernel(up, config=config)
for parameter in ast.get_parameters():
assert not isinstance(parameter.symbol, CFunction)
code = ps.get_code_str(ast)
# print(code)
......@@ -294,7 +278,7 @@ def test_div_and_unevaluated_expr(dtype, instruction_set):
@pytest.mark.parametrize('dtype', ('float32', 'float64'))
@pytest.mark.parametrize('instruction_set', ('sve', 'sve2', 'sme', 'rvv'))
def test_check_ast_parameters(dtype, instruction_set):
def test_check_ast_parameters_sizeless(dtype, instruction_set):
f, g = ps.fields(f"f, g: {dtype}[3D]", layout='fzyx')
update_rule = [ps.Assignment(g.center(), 2 * f.center())]
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment