@@ -78,6 +78,7 @@ namespace detail::ivf {
7878 * Overload for already opened arrays. Since the array is already opened, we
7979 * don't need to specify its type with a template parameter.
8080 */
81+ template <class ids_type = size_t >
8182auto qv_query_heap_infinite_ram (
8283 auto && partitioned_db,
8384 auto && centroids,
@@ -113,7 +114,7 @@ auto qv_query_heap_infinite_ram(
113114 auto partitioned_db = tdbColMajorMatrix<T>(ctx, part_uri);
114115 auto partitioned_ids = read_vector<partitioned_ids_type>(ctx, id_uri);
115116
116- return qv_query_heap_infinite_ram (
117+ return qv_query_heap_infinite_ram<partitioned_ids_type> (
117118 partitioned_db,
118119 centroids,
119120 q,
@@ -148,6 +149,7 @@ auto qv_query_heap_infinite_ram(
148149 * @param nthreads How many threads to use for parallel execution
149150 * @return The indices of the top_k neighbors for each query vector
150151 */
152+ template <class ids_type = size_t >
151153auto qv_query_heap_infinite_ram (
152154 const std::string& part_uri,
153155 auto && centroids,
@@ -158,7 +160,7 @@ auto qv_query_heap_infinite_ram(
158160 size_t k_nn,
159161 size_t nthreads) {
160162 tiledb::Context ctx;
161- return qv_query_heap_infinite_ram (
163+ return qv_query_heap_infinite_ram<ids_type> (
162164 ctx, part_uri, centroids, q, indices, id_uri, nprobe, k_nn, nthreads);
163165}
164166
@@ -188,6 +190,7 @@ auto qv_query_heap_infinite_ram(
188190 * @return The indices of the top_k neighbors for each query vector
189191 */
190192// @todo We should still order the queries so partitions are searched in order
193+ template <class ids_type >
191194auto qv_query_heap_infinite_ram (
192195 auto && partitioned_db,
193196 auto && centroids,
@@ -221,8 +224,8 @@ auto qv_query_heap_infinite_ram(
221224 auto top_centroids =
222225 detail::flat::qv_query_heap_0 (centroids, q, nprobe, nthreads);
223226
224- auto min_scores = std::vector<fixed_min_pair_heap<float , size_t >>(
225- size (q), fixed_min_pair_heap<float , size_t >(k_nn));
227+ auto min_scores = std::vector<fixed_min_pair_heap<float , ids_type >>(
228+ size (q), fixed_min_pair_heap<float , ids_type >(k_nn));
226229
227230 // Parallelizing over q is not going to be very efficient
228231 {
@@ -244,7 +247,7 @@ auto qv_query_heap_infinite_ram(
244247 });
245248 }
246249
247- auto top_k = get_top_k_with_scores (min_scores, k_nn);
250+ auto top_k = get_top_k_with_scores<fixed_min_pair_heap< float , ids_type>, ids_type> (min_scores, k_nn);
248251 return top_k;
249252}
250253
0 commit comments