Skip to content
Snippets Groups Projects
Commit e0347f54 authored by Richard Angersbach's avatar Richard Angersbach
Browse files

Merge branch 'rangersbach/reductions' of i10git.cs.fau.de:pycodegen/pystencils...

Merge branch 'rangersbach/reductions' of i10git.cs.fau.de:pycodegen/pystencils into rangersbach/reductions

# Conflicts:
#	src/pystencils/backend/kernelcreation/freeze.py
parents 90ca9ead 3fc9a049
Branches
1 merge request!438Reduction Support
Pipeline #72401 failed with stages
in 5 minutes
This commit is part of merge request !438. Comments created here will be created in the context of that merge request.
...@@ -213,10 +213,10 @@ class FreezeExpressions: ...@@ -213,10 +213,10 @@ class FreezeExpressions:
init_val = PsConstantExpr(PsConstant(1)) init_val = PsConstantExpr(PsConstant(1))
new_rhs = mul(new_lhs.clone(), rhs) new_rhs = mul(new_lhs.clone(), rhs)
case "min": case "min":
init_val = PsCall(PsMathFunction(NumericLimitsFunctions.Min), []) init_val = PsCall(PsMathFunction(NumericLimitsFunctions.Max), [])
new_rhs = PsCall(PsMathFunction(MathFunctions.Min), [new_lhs.clone(), rhs]) new_rhs = PsCall(PsMathFunction(MathFunctions.Min), [new_lhs.clone(), rhs])
case "max": case "max":
init_val = PsCall(PsMathFunction(NumericLimitsFunctions.Max), []) init_val = PsCall(PsMathFunction(NumericLimitsFunctions.Min), [])
new_rhs = PsCall(PsMathFunction(MathFunctions.Max), [new_lhs.clone(), rhs]) new_rhs = PsCall(PsMathFunction(MathFunctions.Max), [new_lhs.clone(), rhs])
case _: case _:
raise FreezeError(f"Unsupported reduced assignment: {expr.op}.") raise FreezeError(f"Unsupported reduced assignment: {expr.op}.")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment