Skip to content

Commit 1fe0cff

Browse files
author
mnorris11
committed
Trim optimize() doc and inline comments
1 parent dc3502f commit 1fe0cff

2 files changed

Lines changed: 4 additions & 16 deletions

File tree

cpp/include/cuvs/neighbors/cagra.hpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4641,7 +4641,7 @@ std::pair<size_t, size_t> cagra_build_mem_usage(raft::resources const& res,
46414641
/**
46424642
* @brief Optimize a KNN graph into a CAGRA graph.
46434643
*
4644-
* This function optimizes a k-NN graph to create a CAGRA graph.
4644+
* This function optimizes a host-side k-NN graph to create a CAGRA graph.
46454645
* The input/output graphs must be on host memory.
46464646
*
46474647
* Usage example:
@@ -4665,16 +4665,10 @@ void optimize(raft::resources const& handle,
46654665
bool guarantee_connectivity = false);
46664666

46674667
/**
4668-
* @brief Optimize a KNN graph into a CAGRA graph without leaving device memory.
4669-
*
4670-
* Same as the host overload, but both graphs stay in device memory. Pruning,
4671-
* reverse-graph construction and the final merge all run on device with no host
4672-
* staging. This avoids copying the graph out and back, and avoids serialising the
4673-
* reverse-graph phase into `graph_degree` separate host gathers, each with its own
4674-
* H2D copy and stream synchronisation.
4668+
* @brief Optimize a KNN graph into a CAGRA graph.
46754669
*
4676-
* Prefer this overload when the k-NN graph is already on device, for example the
4677-
* output of `all_neighbors::build`.
4670+
* This function optimizes a device-side k-NN graph to create a CAGRA graph.
4671+
* The input/output graphs must be on device memory.
46784672
*
46794673
* Usage example:
46804674
* @code{.cpp}

cpp/src/neighbors/detail/cagra/cagra_build.cuh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,12 +1952,6 @@ void optimize(
19521952
{
19531953
using internal_IdxT = typename std::make_unsigned<IdxT>::type;
19541954

1955-
// Propagate the caller's memory types rather than erasing them to
1956-
// `memory_type::host`. Erasing them makes the device-resident branches
1957-
// inside graph::optimize unreachable -- the `is_device_accessible` path in
1958-
// make_reverse_graph_gpu, and the zero-copy `kPassthrough` mode of
1959-
// batch_load_iterator -- so a caller that already holds the graph on device
1960-
// is forced through host staging.
19611955
using g_accessor_internal =
19621956
raft::host_device_accessor<cuda::std::default_accessor<internal_IdxT>, g_accessor::mem_type>;
19631957
using n_accessor_internal =

0 commit comments

Comments
 (0)