Skip to content

Commit

Permalink
Fix examples/summation.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ishiy1993 committed Jan 9, 2025
1 parent 4062e28 commit 54dabe2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/summation.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def summation(*, length, num_qpus=8, unroll_shift=2):
drv.execute(code, unif.addresses()[0], thread=num_qpus)
end = monotonic()

assert sum(Y.astype(int)) % 2**32 == (length - 1) * length // 2 % 2**32
assert int(sum(Y.astype(int))) % 2**32 == (length - 1) * length // 2 % 2**32

print(f'{end - start} sec, {length * 4 / (end - start) * 1e-6} MB/s')

Expand Down

0 comments on commit 54dabe2

Please sign in to comment.