@@ -172,21 +172,34 @@ def dimensions(self):
172172 return set ().union (* [i ._defines for i in self .ispace .dimensions ])
173173
174174 @cached_property
175- def used_dimensions (self ):
175+ def exprs_dimensions (self ):
176176 """
177- The Dimensions that *actually* appear among the expressions in ``self``.
178- These do not necessarily coincide the IterationSpace Dimensions; for
179- example, reduction or redundant (i.e., invariant) Dimensions won't
180- appear in an expression.
177+ The Dimensions that appear explicitly in the Cluster expressions.
181178 """
182- dims_exprs = {i for i in self .free_symbols if i .is_Dimension }
183-
179+ dims_explicit = {i for i in self .free_symbols if i .is_Dimension }
184180 dims_implicit = set ().union (* [set (e .implicit_dims ) for e in self .exprs ])
181+ return dims_explicit | dims_implicit
185182
183+ @cached_property
184+ def guards_dimensions (self ):
185+ """
186+ The Dimensions that appear explicitly in the Cluster guards.
187+ """
186188 syms_guards = set ().union (* [e .free_symbols for e in self .guards .values ()])
187189 dims_guards = {i for i in syms_guards if i .is_Dimension }
190+ return dims_guards
188191
189- return dims_exprs | dims_implicit | dims_guards
192+ @cached_property
193+ def used_dimensions (self ):
194+ """
195+ All the Dimensions that appear explicitly either within the expressions
196+ or the guards.
197+
198+ Note that, in some cases, some of the IterationSpace Dimensions might
199+ not appear here among the used Dimensions -- for example, reduction or
200+ redundant (i.e., invariant) Dimensions.
201+ """
202+ return self .exprs_dimensions | self .guards_dimensions
190203
191204 @cached_property
192205 def dist_dimensions (self ):
0 commit comments