diff --git a/doc/reference.rst b/doc/reference.rst index 66eb78593e9a5fba6a82beae5bfbc24729301cff..529e866773e2f0c0b5178f347154d794185ea056 100644 --- a/doc/reference.rst +++ b/doc/reference.rst @@ -201,7 +201,9 @@ Wrangling inames .. autofunction:: set_loop_priority -.. autofunction:: split_reduction +.. autofunction:: split_reduction_inward + +.. autofunction:: split_reduction_outward Dealing with Substitution Rules ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/loopy/__init__.py b/loopy/__init__.py index 3b22e4c978da233aafe64909969cdd8447472b03..37fe6f32075c54334b931fb1e1cfe592347cb68c 100644 --- a/loopy/__init__.py +++ b/loopy/__init__.py @@ -1122,8 +1122,7 @@ class _ReductionSplitter(ExpandingIdentityMapper): return ExpandingIdentityMapper.map_reduction(self, expr, expn_state) -def split_reduction(kernel, inames, direction, within=None): - # FIXME document me +def _split_reduction(kernel, inames, direction, within=None): if direction not in ["in", "out"]: raise ValueError("invalid value for 'direction': %s" % direction) @@ -1137,6 +1136,16 @@ def split_reduction(kernel, inames, direction, within=None): rsplit = _ReductionSplitter(kernel, within, inames, direction) return rsplit.map_kernel(kernel) + +def split_reduction_inward(kernel, inames, within=None): + # FIXME document me + _split_reduction(kernel, inames, "in", within) + + +def split_reduction_outward(kernel, inames, within=None): + # FIXME document me + _split_reduction(kernel, inames, "out", within) + # }}} # vim: foldmethod=marker diff --git a/test/test_loopy.py b/test/test_loopy.py index cb7a9e5b3839630880dfa587600d0569c4f48128..4559174812e5e3d15818df395798a88a4be7c95f 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -1264,7 +1264,7 @@ def test_split_reduction(ctx_factory): None, shape=None), "..."]) - knl = lp.split_reduction(knl, "j,k", "out") + knl = lp.split_reduction_outward(knl, "j,k") print knl # FIXME: finish test