Skip to content

Commit

Permalink
Update HappensAfter docstring, add deprecation warning to depends_on
Browse files Browse the repository at this point in the history
  • Loading branch information
a-alveyblanc committed Jun 20, 2023
1 parent 9822ede commit 4d95975
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions loopy/kernel/instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,23 @@ class HappensAfter:
.. attribute:: variable_name
The name of the variable responsible for the dependency.
The name of the variable responsible for the dependency. For
backward compatibility purposes, this may be *None*. In this case, the
dependency semantics revert to the deprecated, statement-level
dependencies of prior versions of :mod:`loopy`.
.. attribute:: instances_rel
An :class:`islpy.Map` representing the happens-after relationship. The
input of the map is an iname tuple and the output of the map is a set
of iname tuples that must execute after the input.
Dimensions of the map are named according to the order of inames in a
loop nest. The dimensions in the output are appended with a prime to
signify that the iname tuples in the input and output are (possibly)
distinct sets of statement instances despite the inames being "the
same".
As a (deprecated) matter of backward compatibility, this may be *None*,
in which case the semantics revert to the (underspecified) statement-level
dependencies of prior versions of :mod:`loopy`.
Expand Down Expand Up @@ -406,7 +415,6 @@ def get_copy_kwargs(self, **kwargs):
kwargs = super().get_copy_kwargs(**kwargs)

if passed_depends_on:
# warn that this is deprecated
warn("depends_on is deprecated and will stop working in 2024. "
"Instead, use happens_after.", DeprecationWarning, stacklevel=2)
del kwargs["happens_after"]
Expand Down Expand Up @@ -456,6 +464,8 @@ def with_transformed_expressions(self, f, assignee_f=None):

@property
def depends_on(self):
warn("depends_on is deprecated and will stop working in 2024. "
"Instead, use happens_after.", DeprecationWarning, stacklevel=2)
return frozenset(self.happens_after)

@property
Expand Down

0 comments on commit 4d95975

Please sign in to comment.