diff --git a/src/pystencils/backend/ast/vector.py b/src/pystencils/backend/ast/vector.py index 291d76e50c5ab23911f37ff8ab7413868dfa90bc..a074ea6ff9caa4192657eca7215632b86a0d4535 100644 --- a/src/pystencils/backend/ast/vector.py +++ b/src/pystencils/backend/ast/vector.py @@ -56,23 +56,13 @@ class PsVecHorizontal(PsBinOp, PsVectorOp): def __init__( self, - lanes: int, scalar_operand: PsExpression, vector_operand: PsExpression, reduction_op: ReductionOp, ): super().__init__(scalar_operand, vector_operand) - self._lanes = lanes self._reduction_op = reduction_op - @property - def lanes(self) -> int: - return self._lanes - - @lanes.setter - def lanes(self, n: int): - self._lanes = n - @property def scalar_operand(self) -> PsExpression: return self._op1 @@ -99,7 +89,7 @@ class PsVecHorizontal(PsBinOp, PsVectorOp): def _clone_expr(self) -> PsVecHorizontal: return PsVecHorizontal( - self._lanes, self._op1.clone(), self._op2.clone(), self._reduction_op + self._op1.clone(), self._op2.clone(), self._reduction_op ) def structurally_equal(self, other: PsAstNode) -> bool: @@ -107,7 +97,6 @@ class PsVecHorizontal(PsBinOp, PsVectorOp): return False return ( super().structurally_equal(other) - and self._lanes == other._lanes and self._reduction_op == other._reduction_op ) diff --git a/src/pystencils/backend/emission/ir_printer.py b/src/pystencils/backend/emission/ir_printer.py index 22ae2f91a1ee25a3e8b5ab0097f46d5f8e6f05c2..5a3836d50db4a090b5088a0e6e3a7d895f9cd6ec 100644 --- a/src/pystencils/backend/emission/ir_printer.py +++ b/src/pystencils/backend/emission/ir_printer.py @@ -77,14 +77,14 @@ class IRAstPrinter(BasePrinter): f"vec_broadcast<{lanes}>({operand_code})", Ops.Weakest ) - case PsVecHorizontal(lanes, scalar_operand, vector_operand, reduction_op): + case PsVecHorizontal(scalar_operand, vector_operand, reduction_op): pc.push_op(Ops.Weakest, LR.Middle) scalar_operand_code = self.visit(scalar_operand, pc) vector_operand_code = self.visit(vector_operand, pc) pc.pop_op() return pc.parenthesize( - f"vec_horizontal_{reduction_op.name.lower()}<{lanes}>({scalar_operand_code, vector_operand_code})", + f"vec_horizontal_{reduction_op.name.lower()}({scalar_operand_code, vector_operand_code})", Ops.Weakest, ) diff --git a/src/pystencils/backend/transformations/loop_vectorizer.py b/src/pystencils/backend/transformations/loop_vectorizer.py index 48b9ad0da567a6221c33c594795c8d4b6e745ea0..09b0aa5dd2e28b62d22e73e74ab8216bdcaf502e 100644 --- a/src/pystencils/backend/transformations/loop_vectorizer.py +++ b/src/pystencils/backend/transformations/loop_vectorizer.py @@ -162,7 +162,6 @@ class LoopVectorizer: PsAssignment( PsSymbolExpr(symb), PsVecHorizontal( - self._lanes, PsSymbolExpr(symb), PsSymbolExpr(vector_symb), reduction_info.op,