Skip to content

Commit 85aa00b

Browse files
committed
test that argument invocation is preserved for non-executable targets
1 parent cdef4c4 commit 85aa00b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/test_target.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,24 @@ def test_empty_array_stride_check_fortran(ctx_factory):
719719
knl(queue, input=a_f)
720720

721721

722+
def test_non_executable_targets_respect_args():
723+
# See https://github.com/inducer/loopy/issues/648
724+
t_unit = lp.make_kernel(
725+
"{ : }",
726+
"""
727+
a[0] = 1729
728+
""",
729+
[lp.GlobalArg("a,b,c,d,e",
730+
shape=(10,),
731+
dtype="float64")],
732+
target=lp.CTarget()
733+
)
734+
code_str = lp.generate_code_v2(t_unit).device_code()
735+
736+
for var in ["b", "c", "d", "e"]:
737+
assert code_str.find(f"double const *__restrict__ {var}") != -1
738+
739+
722740
if __name__ == "__main__":
723741
if len(sys.argv) > 1:
724742
exec(sys.argv[1])

0 commit comments

Comments
 (0)