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

Fix test cases

parent a87062c5
No related branches found
No related tags found
No related merge requests found
Pipeline #55692 passed
...@@ -26,6 +26,8 @@ def test_type_interference(): ...@@ -26,6 +26,8 @@ def test_type_interference():
assert 'const uint16_t f' in code assert 'const uint16_t f' in code
assert 'const int64_t e' in code assert 'const int64_t e' in code
assert 'const float d = ((float)(b)) + ((float)(c)) + ((float)(e)) + _data_x_00_10[_stride_x_2*ctr_2];' in code assert 'const float d = ((float)(b)) + ((float)(c)) + ((float)(e)) + ' \
assert '_data_x_00_10[_stride_x_2*ctr_2] = ((float)(b)) + ((float)(c)) + _data_x_00_10[_stride_x_2*ctr_2];' in code '_data_x[_stride_x_0*ctr_0 + _stride_x_1*ctr_1 + _stride_x_2*ctr_2];' in code
assert '_data_x[_stride_x_0*ctr_0 + _stride_x_1*ctr_1 + _stride_x_2*ctr_2] = (' \
'(float)(b)) + ((float)(c)) + _data_x[_stride_x_0*ctr_0 + _stride_x_1*ctr_1 + _stride_x_2*ctr_2];' in code
assert 'const double g = a + ((double)(b)) + ((double)(d));' in code assert 'const double g = a + ((double)(b)) + ((double)(d));' in code
...@@ -185,9 +185,11 @@ def test_integer_comparision(dtype): ...@@ -185,9 +185,11 @@ def test_integer_comparision(dtype):
# There should be an explicit cast for the integer zero to the type of the field on the rhs # There should be an explicit cast for the integer zero to the type of the field on the rhs
if dtype == 'float64': if dtype == 'float64':
t = "_data_f_00[_stride_f_1*ctr_1] = ((((dir) == (1))) ? (0.0): (_data_f_00[_stride_f_1*ctr_1]));" t = "_data_f[_stride_f_0*ctr_0 + _stride_f_1*ctr_1] = " \
"((((dir) == (1))) ? (0.0): (_data_f[_stride_f_0*ctr_0 + _stride_f_1*ctr_1]));"
else: else:
t = "_data_f_00[_stride_f_1*ctr_1] = ((((dir) == (1))) ? (0.0f): (_data_f_00[_stride_f_1*ctr_1]));" t = "_data_f[_stride_f_0*ctr_0 + _stride_f_1*ctr_1] = " \
"((((dir) == (1))) ? (0.0f): (_data_f[_stride_f_0*ctr_0 + _stride_f_1*ctr_1]));"
assert t in code assert t in code
......
...@@ -140,7 +140,9 @@ def test_aligned_and_nt_stores(openmp, instruction_set=instruction_set): ...@@ -140,7 +140,9 @@ def test_aligned_and_nt_stores(openmp, instruction_set=instruction_set):
opt = {'instruction_set': instruction_set, 'assume_aligned': True, 'nontemporal': True, opt = {'instruction_set': instruction_set, 'assume_aligned': True, 'nontemporal': True,
'assume_inner_stride_one': True} 'assume_inner_stride_one': True}
update_rule = [ps.Assignment(f.center(), 0.25 * (g[-1, 0] + g[1, 0] + g[0, -1] + g[0, 1]))] update_rule = [ps.Assignment(f.center(), 0.25 * (g[-1, 0] + g[1, 0] + g[0, -1] + g[0, 1]))]
config = pystencils.config.CreateKernelConfig(target=dh.default_target, cpu_vectorize_info=opt, cpu_openmp=openmp) # Without the base pointer spec, the inner store is not aligned
config = pystencils.config.CreateKernelConfig(target=dh.default_target, cpu_vectorize_info=opt, cpu_openmp=openmp,
base_pointer_specification=[['spatialInner0']])
ast = ps.create_kernel(update_rule, config=config) ast = ps.create_kernel(update_rule, config=config)
if instruction_set in ['sse'] or instruction_set.startswith('avx'): if instruction_set in ['sse'] or instruction_set.startswith('avx'):
assert 'stream' in ast.instruction_set assert 'stream' in ast.instruction_set
......
...@@ -116,7 +116,8 @@ def test_alignment_and_correct_ghost_layers(gl_field, gl_kernel, instruction_set ...@@ -116,7 +116,8 @@ def test_alignment_and_correct_ghost_layers(gl_field, gl_kernel, instruction_set
opt = {'instruction_set': instruction_set, 'assume_aligned': True, opt = {'instruction_set': instruction_set, 'assume_aligned': True,
'nontemporal': True, 'assume_inner_stride_one': True} 'nontemporal': True, 'assume_inner_stride_one': True}
config = pystencils.config.CreateKernelConfig(target=dh.default_target, config = pystencils.config.CreateKernelConfig(target=dh.default_target,
cpu_vectorize_info=opt, ghost_layers=gl_kernel) cpu_vectorize_info=opt, ghost_layers=gl_kernel,
base_pointer_specification=[['spatialInner0']])
ast = ps.create_kernel(update_rule, config=config) ast = ps.create_kernel(update_rule, config=config)
kernel = ast.compile() kernel = ast.compile()
if gl_kernel != gl_field: if gl_kernel != gl_field:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment