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

Expand defines in array shapes

parent 2b53dcb6
No related branches found
No related tags found
No related merge requests found
...@@ -901,11 +901,14 @@ def make_kernel(device, domains, instructions, kernel_data=["..."], **kwargs): ...@@ -901,11 +901,14 @@ def make_kernel(device, domains, instructions, kernel_data=["..."], **kwargs):
# {{{ separate temporary variables and arguments # {{{ separate temporary variables and arguments
from loopy.kernel.data import TemporaryVariable from loopy.kernel.data import TemporaryVariable, ArrayBase
kernel_args = [] kernel_args = []
temporary_variables = {} temporary_variables = {}
for dat in kernel_data: for dat in kernel_data:
if isinstance(dat, ArrayBase) and isinstance(dat.shape, tuple):
dat = dat.copy(shape=expand_defines_in_expr(dat.shape, defines))
if isinstance(dat, TemporaryVariable): if isinstance(dat, TemporaryVariable):
temporary_variables[dat.name] = dat temporary_variables[dat.name] = dat
else: else:
......
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