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

Adapt error messages for reduced assignments in freeze.py

parent 3484e7f7
No related branches found
No related tags found
1 merge request!438Reduction Support
...@@ -200,7 +200,8 @@ class FreezeExpressions: ...@@ -200,7 +200,8 @@ class FreezeExpressions:
orig_lhs_symb = lhs.symbol orig_lhs_symb = lhs.symbol
dtype = lhs.dtype dtype = lhs.dtype
assert isinstance(dtype, PsNumericType) assert isinstance(dtype, PsNumericType), \
"Reduction assignments require type information of the lhs symbol."
# 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))
...@@ -226,7 +227,7 @@ class FreezeExpressions: ...@@ -226,7 +227,7 @@ class FreezeExpressions:
case ReductionOp.Max: case ReductionOp.Max:
init_val = PsCall(PsMathFunction(NumericLimitsFunctions.Min), []) init_val = PsCall(PsMathFunction(NumericLimitsFunctions.Min), [])
case _: case _:
raise FreezeError(f"Unsupported reduced assignment: {op}.") raise FreezeError(f"Unsupported kind of reduction assignment: {op}.")
reduction_info = ReductionInfo(op, init_val, orig_lhs_symb_as_ptr) reduction_info = ReductionInfo(op, init_val, orig_lhs_symb_as_ptr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment