change order to tuple in remap preduce tests/demos to match rest of simulator
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 28 Apr 2023 08:48:03 +0000 (01:48 -0700)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:17 +0000 (19:51 +0100)
src/openpower/decoder/isa/remap_preduce_yield.py
src/openpower/decoder/isa/test_remap_preduce_yield.py

index 9e9fa2a69a0efd0a7794149353fff14d6fbcd73a..9111435ed7a83cba9b4035e54c4cfd1bb1c895d4 100644 (file)
@@ -44,7 +44,7 @@ def iterate_indices2(SVSHAPE, pred=None):
     # invert the indices if needed
     if SVSHAPE.invxyz[0]:
         ix.reverse()
-    if SVSHAPE.order != [0, 1, 2] or any(SVSHAPE.invxyz[1:]):
+    if SVSHAPE.order != (0, 1, 2) or any(SVSHAPE.invxyz[1:]):
         raise ValueError("undefined")
     if SVSHAPE.skip & 0b10:
         # this is a scan/prefix-sum rather than a reduction.
@@ -113,7 +113,7 @@ def demo_prefix_sum():
         pass
     SVSHAPE0 = SVSHAPE()
     SVSHAPE0.lims = [xdim, 0, 0]
-    SVSHAPE0.order = [0, 1, 2]
+    SVSHAPE0.order = 0, 1, 2
     SVSHAPE0.mode = 0b10
     SVSHAPE0.skip = 0b10  # prefix-sum lhs
     SVSHAPE0.offset = 0       # experiment with different offset, here
@@ -121,7 +121,7 @@ def demo_prefix_sum():
 
     SVSHAPE1 = SVSHAPE()
     SVSHAPE1.lims = [xdim, 0, 0]
-    SVSHAPE1.order = [0, 1, 2]
+    SVSHAPE1.order = 0, 1, 2
     SVSHAPE1.mode = 0b10
     SVSHAPE1.skip = 0b11  # prefix-sum rhs
     SVSHAPE1.offset = 0       # experiment with different offset, here
index 04b4d93f93162f8700def05215de4d4b6535ff07..fa325bb3b44261f92624fc78f72662eebc0ca247 100644 (file)
@@ -33,7 +33,7 @@ class TestRemapPrefixSum(unittest.TestCase):
     def iterate_indices2_helper(self, reverse, item_count, offset):
         lhs_svshape = MockSVShape(
             lims=[item_count, 0, 0],
-            order=[0, 1, 2],
+            order=(0, 1, 2),
             mode=0b10,
             skip=0b10,  # prefix-sum lhs
             offset=offset,
@@ -41,7 +41,7 @@ class TestRemapPrefixSum(unittest.TestCase):
         )
         rhs_svshape = MockSVShape(
             lims=[item_count, 0, 0],
-            order=[0, 1, 2],
+            order=(0, 1, 2),
             mode=0b10,
             skip=0b11,  # prefix-sum rhs
             offset=offset,