Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions python/tests/kernel/test_assignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,26 +844,27 @@ class MyTuple:
l1: list[int]
l2: list[int]

# FIXME: This test is flaky on py3.11 + arm64 + cuda12.6.
# NOTE: This test is flaky on py3.11 + arm64 + cuda12.6.
# The struct argument marshaling is now correct (see PR #3879), but the
# kernel-internal deep copy and list mutation still produce wrong results
# intermittently on that configuration. Disabling until root cause is
# identified.
# @cudaq.kernel
# def test11(t: MyTuple, size: int) -> list[int]:
# l = [t.copy(deep=True) for _ in range(size)]
# l[0].l1 = [2]
# l[1].l2[0] = 3
# res = [0 for _ in range(4 * len(l))]
# for idx, item in enumerate(l):
# res[4 * idx] = len(item.l1)
# res[4 * idx + 1] = item.l1[0]
# res[4 * idx + 2] = len(item.l2)
# res[4 * idx + 3] = item.l2[0]
# return res
#
# result = test11(MyTuple([1], [1]), 2)
# assert (result == [1, 2, 1, 1, 1, 1, 1, 3])
# See https://github.com/NVIDIA/cuda-quantum/issues/3923
@cudaq.kernel
def test11(t: MyTuple, size: int) -> list[int]:
l = [t.copy(deep=True) for _ in range(size)]
l[0].l1 = [2]
l[1].l2[0] = 3
res = [0 for _ in range(4 * len(l))]
for idx, item in enumerate(l):
res[4 * idx] = len(item.l1)
res[4 * idx + 1] = item.l1[0]
res[4 * idx + 2] = len(item.l2)
res[4 * idx + 3] = item.l2[0]
return res

result = test11(MyTuple([1], [1]), 2)
assert (result == [1, 2, 1, 1, 1, 1, 1, 3])

with pytest.raises(RuntimeError) as e:

Expand Down
Loading