Skip to content
Snippets Groups Projects
Commit 69ffdedf authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

FIX: Slab decomposition should not influence grid sizes.

parent 8cf8b9d5
No related branches found
No related tags found
No related merge requests found
......@@ -107,7 +107,7 @@ Future ideas
Dealt with
^^^^^^^^^^
- test divisibility constraints
- Test divisibility constraints
- Test join_inames
......
......@@ -123,7 +123,9 @@ def intersect_kernel_with_slab(kernel, slab, iname):
home_domain = kernel.domains[hdi]
new_domains = kernel.domains[:]
new_domains[hdi] = home_domain & isl.align_spaces(slab, home_domain)
return kernel.copy(domains=new_domains)
return kernel.copy(domains=new_domains,
get_grid_sizes=kernel.get_grid_sizes)
# {{{ hw-parallel loop
......
......@@ -724,7 +724,12 @@ class LoopKernel(Record):
cache_manager=None,
iname_to_tag_requests=None,
index_dtype=np.int32,
isl_context=None):
isl_context=None,
# When kernels get intersected in slab decomposition,
# their grid sizes shouldn't change. This provides
# a way to forward sub-kernel grid size requests.
get_grid_sizes=None):
"""
:arg domain: a :class:`islpy.BasicSet`, or a string parseable to a basic set by the isl.
Example: "{[i,j]: 0<=i < 10 and 0<= j < 9}"
......@@ -995,6 +1000,10 @@ class LoopKernel(Record):
if np.iinfo(index_dtype).min >= 0:
raise TypeError("index_dtype must be signed")
if get_grid_sizes is not None:
# overwrites method down below
self.get_grid_sizes = get_grid_sizes
Record.__init__(self,
device=device, domains=domains,
instructions=parsed_instructions,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment