diff --git a/src/pystencils/backends/cbackend.py b/src/pystencils/backends/cbackend.py index e95fb57903cf6fb7c2aaaf7d5679118d67097b46..10ef12e8329091341cb73ef8416bf4e960ae27e2 100644 --- a/src/pystencils/backends/cbackend.py +++ b/src/pystencils/backends/cbackend.py @@ -614,9 +614,7 @@ class VectorizedCustomSympyPrinter(CustomSympyPrinter): return None def _print_Abs(self, expr): - if 'abs' in self.instruction_set: - return self.instruction_set['abs'].format(self._print(expr.args[0]), **self._kwargs) - return super()._print_Abs(expr) + return self.instruction_set['abs'].format(self._print(expr.args[0]), **self._kwargs) def _typed_vectorized_number(self, expr, data_type): basic_data_type = data_type.base_type diff --git a/tests/test_vectorization_specific.py b/tests/test_vectorization_specific.py index 05a62476e61b1328d72891e4a0aae40ed2c6e6a6..e8b34a2ac8b327b630014907368e87b39c71eab5 100644 --- a/tests/test_vectorization_specific.py +++ b/tests/test_vectorization_specific.py @@ -39,7 +39,7 @@ def test_vectorisation_varying_arch(instruction_set): @pytest.mark.parametrize('dtype', ('float32', 'float64')) @pytest.mark.parametrize('instruction_set', supported_instruction_sets) -def test_vectorized_abs(instruction_set, dtype): +def test_vectorized_abs_field(instruction_set, dtype): """Some instructions sets have abs, some don't. Furthermore, the special treatment of unary minus makes this data type-sensitive too. """ @@ -59,7 +59,7 @@ def test_vectorized_abs(instruction_set, dtype): @pytest.mark.parametrize('instruction_set', supported_instruction_sets) -def test_vectorized_abs(instruction_set): +def test_vectorized_abs_scalar(instruction_set): """Some instructions sets have abs, some don't. Furthermore, the special treatment of unary minus makes this data type-sensitive too. """