Skip to content
Snippets Groups Projects

Reduction Support

Open Richard Angersbach requested to merge rangersbach/reductions into v2.0-dev
Viewing commit 9bbb8181
Show latest version
1 file
+ 4
3
Preferences
Compare changes
@@ -3,17 +3,18 @@ import numpy as np
import sympy as sp
import pystencils as ps
from pystencils import AddReducedAssignment
from pystencils.sympyextensions import reduced_assign
@pytest.mark.parametrize('dtype', ["float64"])
def test_reduction(dtype):
@pytest.mark.parametrize("op", ["+", "-", "*", "min", "max"])
def test_reduction(dtype, op):
x = ps.fields(f'x: {dtype}[1d]')
w = sp.Symbol("w")
# kernel with reduction assignment
reduction_assignment = AddReducedAssignment(w, x.center())
reduction_assignment = reduced_assign(w, op, x.center())
config = ps.CreateKernelConfig(cpu_openmp=True)