Skip to content
Snippets Groups Projects

Reduction Support

Open Richard Angersbach requested to merge rangersbach/reductions into v2.0-dev
Viewing commit c73deaf6
Show latest version
5 files
+ 13
12
Preferences
Compare changes
Files
5
@@ -13,7 +13,7 @@ from ...sympyextensions import (
@@ -13,7 +13,7 @@ from ...sympyextensions import (
integer_functions,
integer_functions,
ConditionalFieldAccess,
ConditionalFieldAccess,
)
)
from ...sympyextensions.binop_mapping import binop_str_to_expr
from ...binop_mapping import binop_str_to_expr
from ...sympyextensions.typed_sympy import TypedSymbol, CastFunc, DynamicType
from ...sympyextensions.typed_sympy import TypedSymbol, CastFunc, DynamicType
from ...sympyextensions.pointers import AddressOf, mem_acc
from ...sympyextensions.pointers import AddressOf, mem_acc
from ...sympyextensions.reduction import ReducedAssignment
from ...sympyextensions.reduction import ReducedAssignment
@@ -185,6 +185,8 @@ class FreezeExpressions:
@@ -185,6 +185,8 @@ class FreezeExpressions:
orig_lhs_symb = lhs.symbol
orig_lhs_symb = lhs.symbol
dtype = rhs.dtype # TODO: kernel with (implicit) up/downcasts?
dtype = rhs.dtype # TODO: kernel with (implicit) up/downcasts?
 
assert isinstance(dtype, PsNumericType)
 
# replace original symbol with pointer-based type used for export
# replace original symbol with pointer-based type used for export
orig_lhs_symb_as_ptr = PsSymbol(orig_lhs_symb.name, PsPointerType(dtype))
orig_lhs_symb_as_ptr = PsSymbol(orig_lhs_symb.name, PsPointerType(dtype))
@@ -196,7 +198,6 @@ class FreezeExpressions:
@@ -196,7 +198,6 @@ class FreezeExpressions:
new_rhs: PsExpression = binop_str_to_expr(expr.op, new_lhs.clone(), rhs)
new_rhs: PsExpression = binop_str_to_expr(expr.op, new_lhs.clone(), rhs)
# match for reduction operation and set neutral init_val
# match for reduction operation and set neutral init_val
new_rhs: PsExpression
init_val: PsExpression
init_val: PsExpression
match expr.op:
match expr.op:
case "+":
case "+":