From 6e586feb24fbf9828d3358e15ea076c299596372 Mon Sep 17 00:00:00 2001
From: Markus Holzer <markus.holzer@fau.de>
Date: Thu, 10 Feb 2022 15:29:30 +0100
Subject: [PATCH] test

---
 pystencils_tests/test_vectorization_specific.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/pystencils_tests/test_vectorization_specific.py b/pystencils_tests/test_vectorization_specific.py
index 7929266d..9b9d3469 100644
--- a/pystencils_tests/test_vectorization_specific.py
+++ b/pystencils_tests/test_vectorization_specific.py
@@ -61,7 +61,6 @@ def test_vectorized_abs(instruction_set, dtype):
 @pytest.mark.parametrize('dtype', ('float', 'double'))
 @pytest.mark.parametrize('instruction_set', supported_instruction_sets)
 def test_strided(instruction_set, dtype):
-    npdtype = np.float64 if dtype == 'double' else np.float32
     type_string = "float64" if dtype == 'double' else "float32"
 
     f, g = ps.fields(f"f, g : {type_string}[2D]")
@@ -84,10 +83,16 @@ def test_strided(instruction_set, dtype):
     ref_config = pystencils.config.CreateKernelConfig(default_number_float=type_string)
     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)
-    arr = np.reshape(np.linspace(0, 1, size[0] * size[1]), size).astype(npdtype)
-    dst = np.zeros_like(arr, dtype=npdtype)
-    ref = np.zeros_like(arr, dtype=npdtype)
+    arr = np.zeros(size).astype(type_string)
+    for i in range(size[0]):
+        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)
     ref_func(g=ref, f=arr)
-- 
GitLab