Skip to content

Commit

Permalink
test that argument invocation is preserved for non-executable targets
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikcfd committed Oct 20, 2022
1 parent a0e17df commit 94572d7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/test_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,24 @@ def test_passing_bajillions_of_svm_args(ctx_factory, with_gbarrier):
assert (res[f"c{iargset}"].get() == iargset * multiplier + iargset).all()


def test_non_executable_targets_respect_args():
# See https://github.com/inducer/loopy/issues/648
t_unit = lp.make_kernel(
"{ : }",
"""
a[0] = 1729
""",
[lp.GlobalArg("a,b,c,d,e",
shape=(10,),
dtype="float64")],
target=lp.CTarget()
)
code_str = lp.generate_code_v2(t_unit).device_code()

for var in ["b", "c", "d", "e"]:
assert code_str.find(f"double const *__restrict__ {var}") != -1


if __name__ == "__main__":
if len(sys.argv) > 1:
exec(sys.argv[1])
Expand Down

0 comments on commit 94572d7

Please sign in to comment.