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
9 changes: 5 additions & 4 deletions cpp/src/neighbors/detail/nn_descent.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -491,11 +491,12 @@ __device__ __forceinline__ void remove_duplicates(
template <typename Index_t, typename ID_t = InternalID_t<Index_t>>
RAFT_KERNEL
#ifdef __CUDA_ARCH__
#if (__CUDA_ARCH__) == 750 || ((__CUDA_ARCH__) >= 860 && (__CUDA_ARCH__) <= 890) || \
(__CUDA_ARCH__) == 1200
__launch_bounds__(BLOCK_SIZE)
#else
// Use minBlocksPerMultiprocessor = 4 on specific arches
#if (__CUDA_ARCH__) == 700 || (__CUDA_ARCH__) == 800 || (__CUDA_ARCH__) == 900 || \
(__CUDA_ARCH__) == 1000
__launch_bounds__(BLOCK_SIZE, 4)
#else
__launch_bounds__(BLOCK_SIZE)
#endif
#endif
local_join_kernel(const Index_t* graph_new,
Expand Down
23 changes: 8 additions & 15 deletions cpp/tests/neighbors/ann_cagra.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1035,29 +1035,22 @@ class AnnCagraIndexMergeTest : public ::testing::TestWithParam<AnnCagraInputs> {
auto database1_view = raft::make_device_matrix_view<const DataT, int64_t>(
(const DataT*)database.data() + database0_view.size(), database1_size, ps.dim);

cagra::index<DataT, IdxT> index0(handle_);
cagra::index<DataT, IdxT> index1(handle_);
cagra::index<DataT, IdxT> index0(handle_, index_params.metric);
cagra::index<DataT, IdxT> index1(handle_, index_params.metric);
std::optional<raft::host_matrix<DataT, int64_t>> database_host{std::nullopt};
if (ps.host_dataset) {
database_host = raft::make_host_matrix<DataT, int64_t>(handle_, ps.n_rows, ps.dim);
raft::copy(database_host->data_handle(), database.data(), database.size(), stream_);
{
std::optional<raft::host_matrix<DataT, int64_t>> database_host{std::nullopt};
database_host = raft::make_host_matrix<DataT, int64_t>(database0_size, ps.dim);
raft::copy(database_host->data_handle(),
database0_view.data_handle(),
database0_view.size(),
stream_);
auto database_host_view = raft::make_host_matrix_view<const DataT, int64_t>(
(const DataT*)database_host->data_handle(), database0_size, ps.dim);
index0 = cagra::build(handle_, index_params, database_host_view);
}
{
std::optional<raft::host_matrix<DataT, int64_t>> database_host{std::nullopt};
database_host = raft::make_host_matrix<DataT, int64_t>(database1_size, ps.dim);
raft::copy(database_host->data_handle(),
database1_view.data_handle(),
database1_view.size(),
stream_);
auto database_host_view = raft::make_host_matrix_view<const DataT, int64_t>(
(const DataT*)database_host->data_handle(), database1_size, ps.dim);
(const DataT*)database_host->data_handle() + database0_size * ps.dim,
database1_size,
ps.dim);
index1 = cagra::build(handle_, index_params, database_host_view);
}
} else {
Expand Down