diff --git a/doc/ref_transform.rst b/doc/ref_transform.rst index 4a07b63330747aa69d7ed498e004d60b7c312a7b..d293e3ebe998a632bd547f94a67e675ff0592bfb 100644 --- a/doc/ref_transform.rst +++ b/doc/ref_transform.rst @@ -72,6 +72,8 @@ Manipulating Instructions .. autofunction:: tag_instructions +.. autofunction:: add_nosync + Registering Library Routines ---------------------------- diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 942c7d56e01f9d037b0e2b601f88bc8b96dda151..5eaa12b8124f86cfaf08cf2e83c3382861d9e0f2 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -1479,6 +1479,8 @@ Barriers :mod:`loopy` may infer the need for a barrier when it is not necessary. The ``no_sync_with`` instruction attribute can be used to resolve this. +See also :func:`loopy.add_nosync`. + TODO .. }}} diff --git a/loopy/transform/instruction.py b/loopy/transform/instruction.py index 67eebc3e0b2523038ae6b3cc4c20e9b348dff1f7..2be78f8e5c25a3b48c195f52715f9d6453100e3b 100644 --- a/loopy/transform/instruction.py +++ b/loopy/transform/instruction.py @@ -230,22 +230,24 @@ def tag_instructions(kernel, new_tag, within=None): def add_nosync(kernel, scope, source, sink, bidirectional=False, force=False): """Add a *no_sync_with* directive between *source* and *sink*. - *no_sync_with* is only added if an (execution) dependency - is present or if the instruction pair is in a conflicting group - (this does not check for memory dependencies). + *no_sync_with* is only added if *sink* depends on *source* or + if the instruction pair is in a conflicting group. - :arg kernel: + This function does not check for the presence of a memory dependency. + + :arg kernel: The kernel :arg source: Either a single instruction id, or any instruction id match understood by :func:`loopy.match.parse_match`. :arg sink: Either a single instruction id, or any instruction id match understood by :func:`loopy.match.parse_match`. - :arg scope: A string which is a valid *no_sync_with* scope. + :arg scope: A valid *no_sync_with* scope. See + :attr:`loopy.InstructionBase.no_sync_with` for allowable scopes. :arg bidirectional: A :class:`bool`. If *True*, add a *no_sync_with* to both the source and sink instructions, otherwise the directive is only added to the sink instructions. - :arg force: A :class:`bool`. If *True*, will add a *no_sync_with* - even without the presence of a syntactic dependency edge/ - conflicting instruction group. + :arg force: A :class:`bool`. If *True*, add a *no_sync_with* directive + even without the presence of a dependency edge or conflicting + instruction group. :return: The updated kernel """