From efdf0d5e135b50e17075e92d1093b0eaac259975 Mon Sep 17 00:00:00 2001 From: Matt Wala <wala1@illinois.edu> Date: Thu, 13 Apr 2017 10:07:44 -0500 Subject: [PATCH] * Tweak *add_nosync* documentation. * Make *add_nosync* visible in the loopy docs. --- doc/ref_transform.rst | 2 ++ doc/tutorial.rst | 2 ++ loopy/transform/instruction.py | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/doc/ref_transform.rst b/doc/ref_transform.rst index 4a07b6333..d293e3ebe 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 942c7d56e..5eaa12b81 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 67eebc3e0..2be78f8e5 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 """ -- GitLab