Skip to content

Commit

Permalink
LoopKernel.combine_domains: Handle inames that occur as parameters in…
Browse files Browse the repository at this point in the history
… other domains (closes gh-770)
  • Loading branch information
inducer committed May 10, 2023
1 parent 2639ddb commit 128417d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions loopy/kernel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,20 @@ def combine_domains(self, domains: Sequence[int]) -> isl.BasicSet:
dom, result)
result = aligned_result & aligned_dom

assert result is not None
# Subdomains may carry other domains' inames as parameters.
# Move them back into the 'set' part of the space.
param_names = {
result.get_dim_name(dim_type.param, i)
for i in range(result.dim(dim_type.param))}
for actual_iname in param_names - self.all_params():
result = result.move_dims(
dim_type.set,
result.dim(dim_type.set),
dim_type.param,
result.find_dim_by_name(dim_type.param, actual_iname),
1)

return result

def get_inames_domain(self, inames: FrozenSet[str]) -> isl.BasicSet:
Expand Down

0 comments on commit 128417d

Please sign in to comment.