Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions cpp/src/neighbors/ivf_flat/ivf_flat_interleaved_scan.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -875,7 +875,10 @@ RAFT_KERNEL __launch_bounds__(kThreadsPerBlock)
uint32_t sample_offset = 0;
if (probe_id > 0) { sample_offset = chunk_indices[probe_id - 1]; }
assert(list_length == chunk_indices[probe_id] - sample_offset);
assert(sample_offset + list_length <= max_samples);
if constexpr (!kManageLocalTopK) {
// max_samples is zero/unused in the kManageLocalTopK mode
assert(sample_offset + list_length <= max_samples);
}

constexpr int kUnroll = raft::WarpSize / Veclen;
constexpr uint32_t kNumWarps = kThreadsPerBlock / raft::WarpSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,10 @@ __device__ __forceinline__ void interleaved_scan_kernel_impl(const uint32_t quer
uint32_t sample_offset = 0;
if (probe_id > 0) { sample_offset = chunk_indices[probe_id - 1]; }
assert(list_length == chunk_indices[probe_id] - sample_offset);
assert(sample_offset + list_length <= max_samples);
if constexpr (!kManageLocalTopK) {
// max_samples is zero/unused in the kManageLocalTopK mode
assert(sample_offset + list_length <= max_samples);
}

constexpr int kUnroll = raft::WarpSize / Veclen;
constexpr uint32_t kNumWarps = kThreadsPerBlock / raft::WarpSize;
Expand Down
Loading