Skip to content
Snippets Groups Projects

Reduction Support

Open Richard Angersbach requested to merge rangersbach/reductions into v2.0-dev
Compare and Show latest version
3 files
+ 5
8
Preferences
Compare changes
Files
3
@@ -62,11 +62,10 @@ from ..ast.vector import PsVecMemAcc
from ..constants import PsConstant
from ...types import PsNumericType, PsStructType, PsType
from ..exceptions import PsInputError
from ..functions import PsMathFunction, MathFunctions
from ..functions import PsMathFunction, MathFunctions, NumericLimitsFunctions
from ..exceptions import FreezeError
import backend.functions
from codegen.properties import ReductionSymbolProperty
from ...codegen.properties import ReductionSymbolProperty
ExprLike = (
@@ -207,10 +206,10 @@ class FreezeExpressions:
# TODO: unsure if sp.Min & sp.Max are mapped by map_Min/map_Max afterwards
case "min":
op = sp.Min
init_val = backend.functions.NumericLimitsFunctions("min")
init_val = NumericLimitsFunctions("min")
case "max":
op = sp.Max
init_val = backend.functions.NumericLimitsFunctions("max")
init_val = NumericLimitsFunctions("max")
case _:
raise FreezeError(f"Unsupported reduced assignment: {expr.op}.")