diff --git a/loopy/schedule/__init__.py b/loopy/schedule/__init__.py index f5b298d5e86d0a594e1db34d616d8f0495184d13..ba69501bacd7d891f5b427a5fb97a413b930777e 100644 --- a/loopy/schedule/__init__.py +++ b/loopy/schedule/__init__.py @@ -2148,7 +2148,9 @@ def get_one_scheduled_kernel(kernel, callables_table): def get_one_linearized_kernel(kernel, callables_table): from loopy import CACHING_ENABLED - sched_cache_key = kernel + # must include *callables_table* within the cache key as the preschedule + # checks depend on it. + sched_cache_key = (kernel, callables_table) from_cache = False if CACHING_ENABLED: diff --git a/test/test_callables.py b/test/test_callables.py index 2118a0fd2e9ad28597142c4fa267beadd833d8ca..7e00e545d974bac411f38afb5881049f3ed09515 100644 --- a/test/test_callables.py +++ b/test/test_callables.py @@ -802,26 +802,26 @@ def test_unused_hw_axes_in_callee(ctx_factory, inline): def test_double_hw_axes_used_in_knl_call(inline): from loopy.diagnostic import LoopyError - thrice = lp.make_function( + twice = lp.make_function( "{[i]: 0<=i<10}", """ y[i] = 2*x[i] - """, name="thrice") + """, name="twice") knl = lp.make_kernel( "{[i]: 0<=i<10}", """ - y[:, i] = thrice(x[:, i]) + y[:, i] = twice(x[:, i]) """, [lp.GlobalArg("x", shape=(10, 10), dtype=float), lp.GlobalArg("y", shape=(10, 10))], name="outer") - thrice = lp.tag_inames(thrice, {"i": "l.0"}) + twice = lp.tag_inames(twice, {"i": "l.0"}) knl = lp.tag_inames(knl, {"i": "l.0"}) - knl = lp.merge([knl, thrice]) + knl = lp.merge([knl, twice]) if inline: - knl = lp.inline_callable_kernel(knl, "thrice") + knl = lp.inline_callable_kernel(knl, "twice") with pytest.raises(LoopyError): lp.generate_code_v2(knl)