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

test

parent aaf88717
No related branches found
No related tags found
No related merge requests found
Pipeline #37525 passed
...@@ -61,7 +61,6 @@ def test_vectorized_abs(instruction_set, dtype): ...@@ -61,7 +61,6 @@ def test_vectorized_abs(instruction_set, dtype):
@pytest.mark.parametrize('dtype', ('float', 'double')) @pytest.mark.parametrize('dtype', ('float', 'double'))
@pytest.mark.parametrize('instruction_set', supported_instruction_sets) @pytest.mark.parametrize('instruction_set', supported_instruction_sets)
def test_strided(instruction_set, dtype): def test_strided(instruction_set, dtype):
npdtype = np.float64 if dtype == 'double' else np.float32
type_string = "float64" if dtype == 'double' else "float32" type_string = "float64" if dtype == 'double' else "float32"
f, g = ps.fields(f"f, g : {type_string}[2D]") f, g = ps.fields(f"f, g : {type_string}[2D]")
...@@ -84,10 +83,16 @@ def test_strided(instruction_set, dtype): ...@@ -84,10 +83,16 @@ def test_strided(instruction_set, dtype):
ref_config = pystencils.config.CreateKernelConfig(default_number_float=type_string) ref_config = pystencils.config.CreateKernelConfig(default_number_float=type_string)
ref_func = ps.create_kernel(update_rule, config=ref_config).compile() ref_func = ps.create_kernel(update_rule, config=ref_config).compile()
# For some reason other array creations fail on the emulated ppc pipeline
size = (25, 19) size = (25, 19)
arr = np.reshape(np.linspace(0, 1, size[0] * size[1]), size).astype(npdtype) arr = np.zeros(size).astype(type_string)
dst = np.zeros_like(arr, dtype=npdtype) for i in range(size[0]):
ref = np.zeros_like(arr, dtype=npdtype) for j in range(size[1]):
arr[i, j] = i * j
dst = np.zeros_like(arr, dtype=type_string)
ref = np.zeros_like(arr, dtype=type_string)
func(g=dst, f=arr) func(g=dst, f=arr)
ref_func(g=ref, f=arr) ref_func(g=ref, f=arr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment