Skip to content
Snippets Groups Projects

[Fix] Vectorisation of Abs

Merged Markus Holzer requested to merge holzer/pystencils:VectorAbs into master
All threads resolved!
Viewing commit e454c84e
Prev
Show latest version
1 file
+ 1
6
Preferences
Compare changes
@@ -614,12 +614,7 @@ class VectorizedCustomSympyPrinter(CustomSympyPrinter):
return None
def _print_Abs(self, expr):
vector_type = False
if isinstance(expr.args[0], VectorMemoryAccess):
vector_type = True
if isinstance(expr.args[0], CastFunc) and isinstance(expr.args[0].args[1], VectorType):
vector_type = True
if vector_type:
if isinstance(get_type_of_expression(expr), (VectorType, VectorMemoryAccess)):
return self.instruction_set['abs'].format(self._print(expr.args[0]), **self._kwargs)
return super()._print_Abs(expr)