diff --git a/pystencils/data_types.py b/pystencils/data_types.py index a4752b148afa43bff9ac39a999b5dc4ca33fd430..20eb94d6b83474bfab46dc491a05b3b1ed2191d9 100644 --- a/pystencils/data_types.py +++ b/pystencils/data_types.py @@ -236,6 +236,14 @@ class TypedSymbol(sp.Symbol): def __getnewargs__(self): return self.name, self.dtype + @property + def canonical(self): + return self + + @property + def reversed(self): + return self + def create_type(specification): """Creates a subclass of Type according to a string or an object of subclass Type. diff --git a/pystencils/simp/assignment_collection.py b/pystencils/simp/assignment_collection.py index fd5c827113ceb776defdcd8cb2ff95bddb293950..ce9f1c9fecaafb62a2f34789fdec5e7a02c537ef 100644 --- a/pystencils/simp/assignment_collection.py +++ b/pystencils/simp/assignment_collection.py @@ -111,6 +111,7 @@ class AssignmentCollection: "Not in SSA form - same symbol assigned multiple times" return bound_symbols_set + @property def free_fields(self): """All fields accessed in the assignment collection, which do not occur as left hand sides in any assignment.""" return {s.field for s in self.free_symbols if hasattr(s, 'field')} diff --git a/pystencils_tests/test_vectorization.py b/pystencils_tests/test_vectorization.py index 1505c7543ee632d1a80a0405fef8e7080fc9bd22..1fa1812eb8fced19d114ef3cb32900ec9b93f995 100644 --- a/pystencils_tests/test_vectorization.py +++ b/pystencils_tests/test_vectorization.py @@ -46,6 +46,7 @@ def test_inplace_update(): kernel(f=arr) np.testing.assert_equal(arr, 2) + def test_vectorization_fixed_size(): configurations = [] # Fixed size - multiple of four