Skip to content

Commit 190f511

Browse files
committed
correct RAFT_EXPECTS
1 parent 07b6bd1 commit 190f511

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

cpp/src/neighbors/ivf_pq/ivf_pq_build.cuh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,12 +1640,17 @@ auto build(
16401640
utils::memzero(owning_index.data_ptrs().data_handle(), owning_index.data_ptrs().size(), stream);
16411641
utils::memzero(owning_index.inds_ptrs().data_handle(), owning_index.inds_ptrs().size(), stream);
16421642

1643-
RAFT_EXPECTS((centers.extent(1) == dim || centers.extent(1) == raft::round_up_safe(dim + 1, 8u)),
1644-
"centers must have extent [n_lists, dim] or [n_lists, round_up(dim + 1, 8)]. "
1645-
"Got centers.extent(1)=%u, expected dim=%u or round_up(dim + 1, 8)=%u",
1646-
centers.extent(1),
1647-
dim,
1648-
raft::round_up_safe(dim + 1, 8u));
1643+
RAFT_EXPECTS(
1644+
(centers.extent(1) == dim || centers.extent(1) == raft::round_up_safe(dim + 1, 8u)) &&
1645+
centers.extent(0) == owning_index.n_lists(),
1646+
"centers must have extent [n_lists, dim] or [n_lists, round_up(dim + 1, 8)]. "
1647+
"Got centers.extent(1)=%u, expected dim=%u or round_up(dim + 1, 8)=%u, and "
1648+
"centers.extent(0)=%u, expected n_lists=%u",
1649+
centers.extent(1),
1650+
dim,
1651+
raft::round_up_safe(dim + 1, 8u),
1652+
centers.extent(0),
1653+
owning_index.n_lists());
16491654

16501655
if (centers.extent(1) == owning_index.dim_ext()) {
16511656
raft::copy(owning_index.centers().data_handle(),

0 commit comments

Comments
 (0)