From 2c5f227ad861fe94dadd3b2520f575add097020b Mon Sep 17 00:00:00 2001
From: Julian Hammer <julian.hammer@fau.de>
Date: Fri, 18 Dec 2020 12:16:33 +0100
Subject: [PATCH] gracefully failing von vectortype

---
 pystencils/sympyextensions.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/pystencils/sympyextensions.py b/pystencils/sympyextensions.py
index 072bb19ae..ce23f4541 100644
--- a/pystencils/sympyextensions.py
+++ b/pystencils/sympyextensions.py
@@ -10,7 +10,7 @@ from sympy.functions import Abs
 from sympy.core.numbers import Zero
 
 from pystencils.assignment import Assignment
-from pystencils.data_types import cast_func, get_type_of_expression, PointerType
+from pystencils.data_types import cast_func, get_type_of_expression, PointerType, VectorType
 from pystencils.kernelparameters import FieldPointerSymbol
 
 T = TypeVar('T')
@@ -465,6 +465,8 @@ def count_operations(term: Union[sp.Expr, List[sp.Expr]],
             base_type = get_type_of_expression(e)
         except ValueError:
             return False
+        if isinstance(base_type, VectorType):
+            return False
         if isinstance(base_type, PointerType):
             return only_type == 'int'
         if only_type == 'int' and (base_type.is_int() or base_type.is_uint()):
-- 
GitLab