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 Jul 14, 2022
1 parent 207ae14 commit 53c0d82
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 @@ -719,6 +719,24 @@ def test_empty_array_stride_check_fortran(ctx_factory):
knl(queue, input=a_f)


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 53c0d82

Please sign in to comment.