Skip to content

to_batched regression

I've the following which was working on master, a few months ago..

knl = lp.make_kernel("{[i,j]:0<=i,j<n}",
                     """
                     <> a = a_values[i]
                     out[i] = a * sum(j, (i/j)*in[i, j])
                     """,
                     target=CTarget())
# in will depend on t
knl2 = lp.to_batched(knl, 'T', ['in'], 't', sequential=True)

which produces the traceback

  File "/Users/maedoc/src/hpc/tvb_hpc/tests.py", line 198, in test_wrap_loop_with_param
    knl2 = lp.to_batched(knl, 'T', ['in'], 't', sequential=True)
  File "/Users/maedoc/src/loopy/loopy/transform/batch.py", line 188, in to_batched
    bvc.map_kernel(knl))
  File "/Users/maedoc/src/loopy/loopy/symbolic.py", line 932, in map_kernel
    for insn in kernel.instructions]
  File "/Users/maedoc/src/loopy/loopy/symbolic.py", line 932, in <listcomp>
    for insn in kernel.instructions]
  File "/Users/maedoc/src/loopy/loopy/kernel/instruction.py", line 851, in with_transformed_expressions
    expression=f(self.expression, *args),
  File "/Users/maedoc/src/loopy/loopy/symbolic.py", line 920, in __call__
    arg_context={}))
  File "/Users/maedoc/src/hpc/venv/lib/python3.6/site-packages/pymbolic/mapper/__init__.py", line 134, in __call__
    return method(expr, *args, **kwargs)
  File "/Users/maedoc/src/hpc/venv/lib/python3.6/site-packages/pymbolic/mapper/__init__.py", line 385, in map_product
    self.rec(child, *args, **kwargs) for child in expr.children))
  File "/Users/maedoc/src/hpc/venv/lib/python3.6/site-packages/pymbolic/mapper/__init__.py", line 385, in <genexpr>
    self.rec(child, *args, **kwargs) for child in expr.children))
  File "/Users/maedoc/src/hpc/venv/lib/python3.6/site-packages/pymbolic/mapper/__init__.py", line 134, in __call__
    return method(expr, *args, **kwargs)
  File "/Users/maedoc/src/loopy/loopy/symbolic.py", line 93, in map_reduction
    % (type(self).__name__, iname))
loopy.diagnostic.LoopyError: _BatchVariableChanger did not map iname 'j' to a variable

If I drop the to_batched, there's no problem.

Before bisect or debug, any ideas?