Skip to content

Commit 9783858

Browse files
committed
modularize fetching the number of candidates
1 parent 7b2d30d commit 9783858

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pyop2/transforms/auto_tiling.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,10 @@ def estimated_exec_time(self, tiling_config):
17661766
)
17671767
return (total_time, nsync)
17681768

1769-
def __call__(self) -> Tuple[ParametricTiling, ...]:
1769+
def _get_all_configurations(self) -> FrozenSet[ParametricTiling]:
1770+
"""
1771+
Returns a :class:`frozenset` of all configurations in our search space.
1772+
"""
17701773
from itertools import product
17711774

17721775
threads_to_cells = {}
@@ -1845,9 +1848,11 @@ def get_eta_shared_mem_alias(tiles):
18451848
False,
18461849
)
18471850
)
1851+
return frozenset(params)
18481852

1849-
# sort the parameters with highest occupancy.
1850-
params.sort(key=lambda P: self.estimated_exec_time(P))
1853+
def __call__(self) -> Tuple[ParametricTiling, ...]:
1854+
params = sorted(self._get_all_configurations(),
1855+
key=self.estimated_exec_time)
18511856

18521857
return tuple(params[: self.num_param_tiling_candidates])
18531858

0 commit comments

Comments
 (0)