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

Expose new reduced assignments to pystencils interface

parent 543bf118
1 merge request!438Reduction Support
...@@ -38,6 +38,14 @@ from .simp import AssignmentCollection ...@@ -38,6 +38,14 @@ from .simp import AssignmentCollection
from .sympyextensions.typed_sympy import TypedSymbol, DynamicType from .sympyextensions.typed_sympy import TypedSymbol, DynamicType
from .sympyextensions import SymbolCreator from .sympyextensions import SymbolCreator
from .datahandling import create_data_handling from .datahandling import create_data_handling
from .sympyextensions.reduction import (
AddReducedAssignment,
SubReducedAssignment,
MulReducedAssignment,
DivReducedAssignment,
MinReducedssignment,
MaxReducedssignment
)
__all__ = [ __all__ = [
"Field", "Field",
...@@ -69,6 +77,12 @@ __all__ = [ ...@@ -69,6 +77,12 @@ __all__ = [
"AssignmentCollection", "AssignmentCollection",
"Assignment", "Assignment",
"AddAugmentedAssignment", "AddAugmentedAssignment",
"AddReducedAssignment",
"SubReducedAssignment",
"MulReducedAssignment",
"DivReducedAssignment",
"MinReducedssignment",
"MaxReducedssignment",
"assignment_from_stencil", "assignment_from_stencil",
"SymbolCreator", "SymbolCreator",
"create_data_handling", "create_data_handling",
......
...@@ -3,7 +3,7 @@ import numpy as np ...@@ -3,7 +3,7 @@ import numpy as np
import sympy as sp import sympy as sp
import pystencils as ps import pystencils as ps
from sympyextensions.reduction import reduced_assign from pystencils import AddReducedAssignment
@pytest.mark.parametrize('dtype', ["float64", "float32"]) @pytest.mark.parametrize('dtype', ["float64", "float32"])
...@@ -32,7 +32,7 @@ def test_log(dtype): ...@@ -32,7 +32,7 @@ def test_log(dtype):
omega = sp.Symbol("omega") omega = sp.Symbol("omega")
reduction_assignment = reduced_assign(omega, "+", x.center()) reduction_assignment = AddReducedAssignment(omega, x.center())
ast_reduction = ps.create_kernel(reduction_assignment, default_dtype=dtype) ast_reduction = ps.create_kernel(reduction_assignment, default_dtype=dtype)
code_reduction = ps.get_code_str(ast_reduction) code_reduction = ps.get_code_str(ast_reduction)
......
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