Skip to content

Commit

Permalink
simplify bin search
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Feb 9, 2021
1 parent 38b1539 commit 3a8eef6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/python/unittest/test_tir_ir_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def binary_search(ib, n, i, Aptr, Bptr, Cptr):
v = Bptr[i]

with ib.while_loop(lo[0] < hi[0]):
mid = lo[0] + tvm.tir.floordiv(hi[0] - lo[0], 2).astype("int32")
mid = lo[0] + (hi[0] - lo[0] >> 1)
with ib.if_scope(Aptr[mid] < v):
lo[0] = mid + 1
with ib.else_scope():
Expand Down

0 comments on commit 3a8eef6

Please sign in to comment.