Precompute fails if there are non-iname dependencies in the rule invocation.
knl = lp.make_kernel(
"{[i,j,k]: 0<=i<100 and 0<=j<32 and 0<=k<8}",
"""
for i
for j
x[j] = 3.14 * (i + j)
y[j] = 0
for k
y[j] = y[j] + L[map[i], k, j] *x[j]
end
out[i, j] = y[j]
end
end
""",
[
lp.GlobalArg('L', dtype=np.float64, shape=(1, 8, 32)),
lp.GlobalArg('map', dtype=np.int32, shape=lp.auto),
lp.TemporaryVariable('x', dtype=np.float64, shape=(32,)),
lp.TemporaryVariable('y', dtype=np.float64, shape=(32,)),
'...'],
seq_dependencies=True,
lang_version=(2018, 2)
)
knl = lp.add_prefetch(knl, "L", sweep_inames="j,k",
fetch_outer_inames="i", temporary_scope=lp.AddressSpace.LOCAL)
fails as --
File "loopy/loopy/transform/precompute.py", line 531, in precompute
raise RuntimeError("no invocations of '%s' found" % subst_name)
RuntimeError: no invocations of 'L_fetch_rule' found
Reason: this FIXME.
Edited by Kaushik Kulkarni