diff --git a/doc/misc.rst b/doc/misc.rst index cd3d205018b455c23b8a6bf56caeff05230c6339..8a03589fd4b347dbf9aebb4c04c3224621ec9c77 100644 --- a/doc/misc.rst +++ b/doc/misc.rst @@ -486,12 +486,3 @@ Cross-References to Other Documentation .. class:: complex128 See :class:`numpy.generic`. - -Type Variables --------------- - -.. currentmodule:: loopy - -.. class:: T_co - - A covariant type variable used in, e.g. :meth:`pytools.tag.Taggable.copy`. diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py index 7425f0d3f45e8d5c18fb8a41a7b1b03abfcc95ee..8ddf3bf17a79550b39e41d0c17f85531489cb411 100644 --- a/loopy/kernel/__init__.py +++ b/loopy/kernel/__init__.py @@ -1659,6 +1659,9 @@ class LoopKernel(ImmutableRecordWithoutPickling, Taggable): return super().copy(**kwargs) + def _with_new_tags(self, tags): + return self.copy(tags=tags) + # }}} # vim: foldmethod=marker diff --git a/loopy/kernel/array.py b/loopy/kernel/array.py index b6ed5518ddab1ba205680945192b70c9859a75da..bffdd84ecf3e29ff822a84c2d4a1c54b84b43ae9 100644 --- a/loopy/kernel/array.py +++ b/loopy/kernel/array.py @@ -924,6 +924,9 @@ class ArrayBase(ImmutableRecord, Taggable): def __ne__(self, other): return not self.__eq__(other) + def _with_new_tags(self, tags): + return self.copy(tags=tags) + def stringify(self, include_typename): import loopy as lp diff --git a/loopy/kernel/data.py b/loopy/kernel/data.py index b8194e107ef22e46aaf06d07565ba1d43ab24367..f2c6420371023c84af9a4d8bc779cd53bd55e58d 100644 --- a/loopy/kernel/data.py +++ b/loopy/kernel/data.py @@ -929,6 +929,9 @@ class Iname(Taggable): return type(self)(name=name, tags=tags) + def _with_new_tags(self, tags): + return self.copy(tags=tags) + def update_persistent_hash(self, key_hash, key_builder): """Custom hash computation function for use with :class:`pytools.persistent_dict.PersistentDict`.