Skip to content

Commit

Permalink
compiler: fix tile input
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Oct 7, 2023
1 parent 732b470 commit 41457f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion devito/passes/iet/parpragma.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def _make_partree(self, candidates, nthreads=None, index=None):
if self._is_offloadable(root):
body = self.DeviceIteration(gpu_fit=self.gpu_fit,
ncollapsed=len(collapsable) + 1,
tile=self.par_tile,
tile=self.par_tile.next(),
**root.args)
partree = ParallelTree([], body, nthreads=nthreads)

Expand Down
2 changes: 2 additions & 0 deletions devito/tools/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ def __init__(self, items):
self.current = 0

def next(self):
if self.last == 0:
return None
item = self.items[self.current]
self.current = min(self.last - 1, self.current+1)
return item
Expand Down

0 comments on commit 41457f1

Please sign in to comment.