repo_id
stringlengths
21
96
file_path
stringlengths
31
155
content
stringlengths
1
92.9M
__index_level_0__
int64
0
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/neighbors/cagra_serialize.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <sstream> #include <string> #include <raft/core/device_resources.hpp> #include <raft/neighbors/cagra_serialize.cuh> #include <raft/neighbors/cagra_types.hpp> #include <raft_runtime/neighbors/cagra.hpp> namespace raft::runtime::neighbors::cagra { #define RAFT_INST_CAGRA_SERIALIZE(DTYPE) \ void serialize_file(raft::resources const& handle, \ const std::string& filename, \ const raft::neighbors::cagra::index<DTYPE, uint32_t>& index, \ bool include_dataset) \ { \ raft::neighbors::cagra::serialize(handle, filename, index, include_dataset); \ }; \ \ void deserialize_file(raft::resources const& handle, \ const std::string& filename, \ raft::neighbors::cagra::index<DTYPE, uint32_t>* index) \ { \ if (!index) { RAFT_FAIL("Invalid index pointer"); } \ *index = raft::neighbors::cagra::deserialize<DTYPE, uint32_t>(handle, filename); \ }; \ void serialize(raft::resources const& handle, \ std::string& str, \ const raft::neighbors::cagra::index<DTYPE, uint32_t>& index, \ bool include_dataset) \ { \ std::stringstream os; \ raft::neighbors::cagra::serialize(handle, os, index, include_dataset); \ str = os.str(); \ } \ \ void deserialize(raft::resources const& handle, \ const std::string& str, \ raft::neighbors::cagra::index<DTYPE, uint32_t>* index) \ { \ std::istringstream is(str); \ if (!index) { RAFT_FAIL("Invalid index pointer"); } \ *index = raft::neighbors::cagra::deserialize<DTYPE, uint32_t>(handle, is); \ } RAFT_INST_CAGRA_SERIALIZE(float); RAFT_INST_CAGRA_SERIALIZE(int8_t); RAFT_INST_CAGRA_SERIALIZE(uint8_t); #undef RAFT_INST_CAGRA_SERIALIZE } // namespace raft::runtime::neighbors::cagra
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/neighbors/ivfpq_deserialize.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq.cuh> #include <raft/neighbors/ivf_pq_serialize.cuh> #include <raft_runtime/neighbors/ivf_pq.hpp> namespace raft::runtime::neighbors::ivf_pq { void deserialize(raft::resources const& handle, const std::string& filename, raft::neighbors::ivf_pq::index<int64_t>* index) { if (!index) { RAFT_FAIL("Invalid index pointer"); } *index = raft::neighbors::ivf_pq::deserialize<int64_t>(handle, filename); }; } // namespace raft::runtime::neighbors::ivf_pq
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/neighbors/ivf_flat_build.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_flat.cuh> #include <raft_runtime/neighbors/ivf_flat.hpp> namespace raft::runtime::neighbors::ivf_flat { #define RAFT_INST_BUILD_EXTEND(T, IdxT) \ auto build(raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset) \ ->raft::neighbors::ivf_flat::index<T, IdxT> \ { \ return raft::neighbors::ivf_flat::build<T, IdxT>(handle, params, dataset); \ } \ auto extend(raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \ const raft::neighbors::ivf_flat::index<T, IdxT>& orig_index) \ ->raft::neighbors::ivf_flat::index<T, IdxT> \ { \ return raft::neighbors::ivf_flat::extend<T, IdxT>( \ handle, new_vectors, new_indices, orig_index); \ } \ \ void build(raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset, \ raft::neighbors::ivf_flat::index<T, IdxT>& idx) \ { \ idx = build(handle, params, dataset); \ } \ \ void extend(raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \ raft::neighbors::ivf_flat::index<T, IdxT>* idx) \ { \ raft::neighbors::ivf_flat::extend<T, IdxT>(handle, new_vectors, new_indices, idx); \ } RAFT_INST_BUILD_EXTEND(float, int64_t); RAFT_INST_BUILD_EXTEND(int8_t, int64_t); RAFT_INST_BUILD_EXTEND(uint8_t, int64_t); #undef RAFT_INST_BUILD_EXTEND } // namespace raft::runtime::neighbors::ivf_flat
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/neighbors/ivfpq_search_int8_t_int64_t.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq.cuh> #include <raft_runtime/neighbors/ivf_pq.hpp> namespace raft::runtime::neighbors::ivf_pq { #define RAFT_SEARCH_INST(T, IdxT) \ void search(raft::resources const& handle, \ const raft::neighbors::ivf_pq::search_params& params, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ raft::device_matrix_view<const T, IdxT, row_major> queries, \ raft::device_matrix_view<IdxT, IdxT, row_major> neighbors, \ raft::device_matrix_view<float, IdxT, row_major> distances) \ { \ raft::neighbors::ivf_pq::search<T, IdxT>(handle, params, idx, queries, neighbors, distances); \ } RAFT_SEARCH_INST(int8_t, int64_t); #undef RAFT_INST_SEARCH } // namespace raft::runtime::neighbors::ivf_pq
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/neighbors/refine_h_int64_t_int8_t.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/refine.cuh> namespace raft::runtime::neighbors { void refine(raft::resources const& handle, raft::host_matrix_view<const int8_t, int64_t, row_major> dataset, raft::host_matrix_view<const int8_t, int64_t, row_major> queries, raft::host_matrix_view<const int64_t, int64_t, row_major> neighbor_candidates, raft::host_matrix_view<int64_t, int64_t, row_major> indices, raft::host_matrix_view<float, int64_t, row_major> distances, distance::DistanceType metric) { raft::neighbors::refine<int64_t, int8_t, float, int64_t>( handle, dataset, queries, neighbor_candidates, indices, distances, metric); } } // namespace raft::runtime::neighbors
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/neighbors/cagra_search.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/cagra.cuh> #include <raft_runtime/neighbors/cagra.hpp> namespace raft::runtime::neighbors::cagra { #define RAFT_INST_CAGRA_SEARCH(T, IdxT) \ void search(raft::resources const& handle, \ raft::neighbors::cagra::search_params const& params, \ const raft::neighbors::cagra::index<T, IdxT>& index, \ raft::device_matrix_view<const T, int64_t, row_major> queries, \ raft::device_matrix_view<IdxT, int64_t, row_major> neighbors, \ raft::device_matrix_view<float, int64_t, row_major> distances) \ { \ raft::neighbors::cagra::search<T, IdxT>(handle, params, index, queries, neighbors, distances); \ } RAFT_INST_CAGRA_SEARCH(float, uint32_t); RAFT_INST_CAGRA_SEARCH(int8_t, uint32_t); RAFT_INST_CAGRA_SEARCH(uint8_t, uint32_t); #undef RAFT_INST_CAGRA_SEARCH } // namespace raft::runtime::neighbors::cagra
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/neighbors/refine_d_int64_t_uint8_t.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/refine.cuh> namespace raft::runtime::neighbors { void refine(raft::resources const& handle, raft::device_matrix_view<const uint8_t, int64_t, row_major> dataset, raft::device_matrix_view<const uint8_t, int64_t, row_major> queries, raft::device_matrix_view<const int64_t, int64_t, row_major> neighbor_candidates, raft::device_matrix_view<int64_t, int64_t, row_major> indices, raft::device_matrix_view<float, int64_t, row_major> distances, distance::DistanceType metric) { raft::neighbors::refine<int64_t, uint8_t, float, int64_t>( handle, dataset, queries, neighbor_candidates, indices, distances, metric); } } // namespace raft::runtime::neighbors
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/matrix/select_k_float_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/core/device_mdspan.hpp> #include <raft/core/resources.hpp> #include <raft/matrix/select_k.cuh> #include <raft_runtime/matrix/select_k.hpp> #include <vector> namespace raft::runtime::matrix { void select_k(const resources& handle, raft::device_matrix_view<const float, int64_t, row_major> in_val, std::optional<raft::device_matrix_view<const int64_t, int64_t, row_major>> in_idx, raft::device_matrix_view<float, int64_t, row_major> out_val, raft::device_matrix_view<int64_t, int64_t, row_major> out_idx, bool select_min) { raft::matrix::select_k(handle, in_val, in_idx, out_val, out_idx, select_min); } } // namespace raft::runtime::matrix
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/kmeans_init_plus_plus_double.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/cluster/kmeans.cuh> #include <raft/core/resource/cuda_stream.hpp> #include <raft/core/resources.hpp> namespace raft::runtime::cluster::kmeans { void init_plus_plus(raft::resources const& handle, const raft::cluster::kmeans::KMeansParams& params, raft::device_matrix_view<const double, int> X, raft::device_matrix_view<double, int> centroids) { rmm::device_uvector<char> workspace(0, resource::get_cuda_stream(handle)); raft::cluster::kmeans::init_plus_plus<double, int>(handle, params, X, centroids, workspace); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/update_centroids.cuh
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/cluster/kmeans.cuh> #include <raft/core/resource/cuda_stream.hpp> #include <raft/core/resource/thrust_policy.hpp> #include <raft/core/resources.hpp> #include <raft/distance/distance_types.hpp> #include <raft/linalg/norm.cuh> namespace raft::runtime::cluster::kmeans { template <typename DataT, typename IndexT> void update_centroids(raft::resources const& handle, const DataT* X, int n_samples, int n_features, int n_clusters, const DataT* sample_weights, const DataT* centroids, const IndexT* labels, DataT* new_centroids, DataT* weight_per_cluster) { auto X_view = raft::make_device_matrix_view<const DataT, IndexT>(X, n_samples, n_features); auto centroids_view = raft::make_device_matrix_view<const DataT, IndexT>(centroids, n_clusters, n_features); rmm::device_uvector<DataT> sample_weights_uvec(0, resource::get_cuda_stream(handle)); if (sample_weights == nullptr) { sample_weights_uvec.resize(n_samples, resource::get_cuda_stream(handle)); DataT weight = 1.0 / n_samples; thrust::fill(resource::get_thrust_policy(handle), sample_weights_uvec.data(), sample_weights_uvec.data() + n_samples, weight); } auto sample_weights_view = raft::make_device_vector_view<const DataT, IndexT>( sample_weights == nullptr ? sample_weights_uvec.data() : sample_weights, n_samples); auto new_centroids_view = raft::make_device_matrix_view<DataT, IndexT>(new_centroids, n_clusters, n_features); rmm::device_uvector<DataT> weight_per_cluster_uvec(0, resource::get_cuda_stream(handle)); if (weight_per_cluster == nullptr) { weight_per_cluster_uvec.resize(n_clusters, resource::get_cuda_stream(handle)); } auto weight_per_cluster_view = raft::make_device_vector_view<DataT, IndexT>( weight_per_cluster == nullptr ? weight_per_cluster_uvec.data() : weight_per_cluster, n_clusters); raft::cluster::kmeans::update_centroids<DataT, IndexT>(handle, X_view, sample_weights_view, centroids_view, labels, weight_per_cluster_view, new_centroids_view); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/cluster_cost.cuh
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/cluster/kmeans.cuh> #include <raft/core/operators.hpp> #include <raft/core/resource/cuda_stream.hpp> #include <raft/core/resource/thrust_policy.hpp> #include <raft/core/resources.hpp> #include <raft/distance/distance_types.hpp> #include <raft/distance/fused_l2_nn.cuh> #include <raft/util/cuda_utils.cuh> namespace raft::runtime::cluster::kmeans { template <typename ElementType, typename IndexType> void cluster_cost(raft::resources const& handle, const ElementType* X, IndexType n_samples, IndexType n_features, IndexType n_clusters, const ElementType* centroids, ElementType* cost) { rmm::device_uvector<char> workspace(n_samples * sizeof(IndexType), resource::get_cuda_stream(handle)); rmm::device_uvector<ElementType> x_norms(n_samples, resource::get_cuda_stream(handle)); rmm::device_uvector<ElementType> centroid_norms(n_clusters, resource::get_cuda_stream(handle)); raft::linalg::rowNorm(x_norms.data(), X, n_features, n_samples, raft::linalg::L2Norm, true, resource::get_cuda_stream(handle)); raft::linalg::rowNorm(centroid_norms.data(), centroids, n_features, n_clusters, raft::linalg::L2Norm, true, resource::get_cuda_stream(handle)); auto min_cluster_distance = raft::make_device_vector<raft::KeyValuePair<IndexType, ElementType>>(handle, n_samples); raft::distance::fusedL2NNMinReduce(min_cluster_distance.data_handle(), X, centroids, x_norms.data(), centroid_norms.data(), n_samples, n_clusters, n_features, (void*)workspace.data(), false, true, resource::get_cuda_stream(handle)); auto distances = raft::make_device_vector<ElementType, IndexType>(handle, n_samples); thrust::transform(resource::get_thrust_policy(handle), min_cluster_distance.data_handle(), min_cluster_distance.data_handle() + n_samples, distances.data_handle(), raft::value_op{}); rmm::device_scalar<ElementType> device_cost(0, resource::get_cuda_stream(handle)); raft::cluster::kmeans::cluster_cost(handle, distances.view(), workspace, make_device_scalar_view<ElementType>(device_cost.data()), raft::add_op{}); raft::update_host(cost, device_cost.data(), 1, resource::get_cuda_stream(handle)); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/kmeans_fit_float.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/cluster/kmeans.cuh> #include <raft/core/resources.hpp> namespace raft::runtime::cluster::kmeans { void fit(raft::resources const& handle, const raft::cluster::kmeans::KMeansParams& params, raft::device_matrix_view<const float, int> X, std::optional<raft::device_vector_view<const float, int>> sample_weight, raft::device_matrix_view<float, int> centroids, raft::host_scalar_view<float, int> inertia, raft::host_scalar_view<int, int> n_iter) { raft::cluster::kmeans::fit<float, int>( handle, params, X, sample_weight, centroids, inertia, n_iter); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/update_centroids_double.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "update_centroids.cuh" #include <raft/core/resources.hpp> #include <raft/distance/distance_types.hpp> namespace raft::runtime::cluster::kmeans { void update_centroids(raft::resources const& handle, const double* X, int n_samples, int n_features, int n_clusters, const double* sample_weights, const double* centroids, const int* labels, double* new_centroids, double* weight_per_cluster) { update_centroids<double, int>(handle, X, n_samples, n_features, n_clusters, sample_weights, centroids, labels, new_centroids, weight_per_cluster); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/kmeans_fit_double.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/cluster/kmeans.cuh> #include <raft/core/resources.hpp> namespace raft::runtime::cluster::kmeans { void fit(raft::resources const& handle, const raft::cluster::kmeans::KMeansParams& params, raft::device_matrix_view<const double, int> X, std::optional<raft::device_vector_view<const double, int>> sample_weight, raft::device_matrix_view<double, int> centroids, raft::host_scalar_view<double, int> inertia, raft::host_scalar_view<int, int> n_iter) { raft::cluster::kmeans::fit<double, int>( handle, params, X, sample_weight, centroids, inertia, n_iter); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/cluster_cost_float.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cluster_cost.cuh" #include <raft/core/resources.hpp> #include <raft/distance/distance_types.hpp> namespace raft::runtime::cluster::kmeans { void cluster_cost(raft::resources const& handle, const float* X, int n_samples, int n_features, int n_clusters, const float* centroids, float* cost) { cluster_cost<float, int>(handle, X, n_samples, n_features, n_clusters, centroids, cost); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/update_centroids_float.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "update_centroids.cuh" #include <raft/core/resources.hpp> #include <raft/distance/distance_types.hpp> namespace raft::runtime::cluster::kmeans { void update_centroids(raft::resources const& handle, const float* X, int n_samples, int n_features, int n_clusters, const float* sample_weights, const float* centroids, const int* labels, float* new_centroids, float* weight_per_cluster) { update_centroids<float, int>(handle, X, n_samples, n_features, n_clusters, sample_weights, centroids, labels, new_centroids, weight_per_cluster); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/cluster_cost_double.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "cluster_cost.cuh" #include <raft/core/resources.hpp> #include <raft/distance/distance_types.hpp> namespace raft::runtime::cluster::kmeans { void cluster_cost(raft::resources const& handle, const double* X, int n_samples, int n_features, int n_clusters, const double* centroids, double* cost) { cluster_cost<double, int>(handle, X, n_samples, n_features, n_clusters, centroids, cost); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src/raft_runtime
rapidsai_public_repos/raft/cpp/src/raft_runtime/cluster/kmeans_init_plus_plus_float.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/cluster/kmeans.cuh> #include <raft/core/resource/cuda_stream.hpp> #include <raft/core/resources.hpp> namespace raft::runtime::cluster::kmeans { void init_plus_plus(raft::resources const& handle, const raft::cluster::kmeans::KMeansParams& params, raft::device_matrix_view<const float, int> X, raft::device_matrix_view<float, int> centroids) { rmm::device_uvector<char> workspace(0, resource::get_cuda_stream(handle)); raft::cluster::kmeans::init_plus_plus<float, int>(handle, params, X, centroids, workspace); } } // namespace raft::runtime::cluster::kmeans
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/core/logger.cpp
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/core/logger-inl.hpp>
0
rapidsai_public_repos/raft/cpp/src/spatial/knn
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/fused_l2_knn_int32_t_float.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cstddef> // size_t #include <cstdint> // int_Xt #include <raft/distance/distance_types.hpp> // DistanceType #include <raft/spatial/knn/detail/fused_l2_knn-inl.cuh> #define instantiate_raft_spatial_knn_detail_fusedL2Knn(Mvalue_idx, Mvalue_t, MusePrevTopKs) \ template void raft::spatial::knn::detail::fusedL2Knn<Mvalue_idx, Mvalue_t, MusePrevTopKs>( \ size_t D, \ Mvalue_idx * out_inds, \ Mvalue_t * out_dists, \ const Mvalue_t* index, \ const Mvalue_t* query, \ size_t n_index_rows, \ size_t n_query_rows, \ int k, \ bool rowMajorIndex, \ bool rowMajorQuery, \ cudaStream_t stream, \ raft::distance::DistanceType metric, \ const Mvalue_t* index_norms, \ const Mvalue_t* query_norms) instantiate_raft_spatial_knn_detail_fusedL2Knn(int32_t, float, true); instantiate_raft_spatial_knn_detail_fusedL2Knn(int32_t, float, false); #undef instantiate_raft_spatial_knn_detail_fusedL2Knn
0
rapidsai_public_repos/raft/cpp/src/spatial/knn
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/fused_l2_knn_int64_t_float.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cstddef> // size_t #include <cstdint> // int_Xt #include <raft/distance/distance_types.hpp> // DistanceType #include <raft/spatial/knn/detail/fused_l2_knn-inl.cuh> #define instantiate_raft_spatial_knn_detail_fusedL2Knn(Mvalue_idx, Mvalue_t, MusePrevTopKs) \ template void raft::spatial::knn::detail::fusedL2Knn<Mvalue_idx, Mvalue_t, MusePrevTopKs>( \ size_t D, \ Mvalue_idx * out_inds, \ Mvalue_t * out_dists, \ const Mvalue_t* index, \ const Mvalue_t* query, \ size_t n_index_rows, \ size_t n_query_rows, \ int k, \ bool rowMajorIndex, \ bool rowMajorQuery, \ cudaStream_t stream, \ raft::distance::DistanceType metric, \ const Mvalue_t* index_norms, \ const Mvalue_t* query_norms) instantiate_raft_spatial_knn_detail_fusedL2Knn(int64_t, float, true); instantiate_raft_spatial_knn_detail_fusedL2Knn(int64_t, float, false); #undef instantiate_raft_spatial_knn_detail_fusedL2Knn
0
rapidsai_public_repos/raft/cpp/src/spatial/knn
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/fused_l2_knn_uint32_t_float.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cstddef> // size_t #include <cstdint> // int_Xt #include <raft/distance/distance_types.hpp> // DistanceType #include <raft/spatial/knn/detail/fused_l2_knn-inl.cuh> #define instantiate_raft_spatial_knn_detail_fusedL2Knn(Mvalue_idx, Mvalue_t, MusePrevTopKs) \ template void raft::spatial::knn::detail::fusedL2Knn<Mvalue_idx, Mvalue_t, MusePrevTopKs>( \ size_t D, \ Mvalue_idx * out_inds, \ Mvalue_t * out_dists, \ const Mvalue_t* index, \ const Mvalue_t* query, \ size_t n_index_rows, \ size_t n_query_rows, \ int k, \ bool rowMajorIndex, \ bool rowMajorQuery, \ cudaStream_t stream, \ raft::distance::DistanceType metric, \ const Mvalue_t* index_norms, \ const Mvalue_t* query_norms) // These are used by brute_force_knn: instantiate_raft_spatial_knn_detail_fusedL2Knn(uint32_t, float, true); instantiate_raft_spatial_knn_detail_fusedL2Knn(uint32_t, float, false); #undef instantiate_raft_spatial_knn_detail_fusedL2Knn
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_two_2d_euclidean.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_two<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( std::int64_t, float, std::uint32_t, 2, raft::spatial::knn::detail::EuclideanFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_two_3d_dist.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_two<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( std::int64_t, float, std::uint32_t, 3, raft::spatial::knn::detail::DistFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_one<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ raft::spatial::knn::detail::DistFunc<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_two<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ raft::spatial::knn::detail::DistFunc<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one(std::int64_t, float, std::uint32_t, 2); instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one(std::int64_t, float, std::uint32_t, 3); instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two(std::int64_t, float, std::uint32_t, 2); instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two(std::int64_t, float, std::uint32_t, 3); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_two_2d_haversine.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_two<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( std::int64_t, float, std::uint32_t, 2, raft::spatial::knn::detail::HaversineFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_one_2d_haversine.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_one<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( std::int64_t, float, std::uint32_t, 2, raft::spatial::knn::detail::HaversineFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_two_3d_euclidean.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_two<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( std::int64_t, float, std::uint32_t, 3, raft::spatial::knn::detail::EuclideanFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_one_3d_euclidean.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_one<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( std::int64_t, float, std::uint32_t, 3, raft::spatial::knn::detail::EuclideanFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_one_2d_euclidean.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_one<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( std::int64_t, float, std::uint32_t, 2, raft::spatial::knn::detail::EuclideanFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_one_2d_dist.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_one<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( std::int64_t, float, std::uint32_t, 2, raft::spatial::knn::detail::DistFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_two_2d_dist.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_two<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( std::int64_t, float, std::uint32_t, 2, raft::spatial::knn::detail::DistFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_one_3d_dist.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_one<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( std::int64_t, float, std::uint32_t, 3, raft::spatial::knn::detail::DistFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_one_3d_haversine.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_one<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( std::int64_t, float, std::uint32_t, 3, raft::spatial::knn::detail::HaversineFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_00_generate.py
# Copyright (c) 2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. header = """/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> """ macro_pass_one = """ #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one( \\ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \\ template void \\ raft::spatial::knn::detail::rbc_low_dim_pass_one<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \\ raft::resources const& handle, \\ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \\ const Mvalue_t* query, \\ const Mvalue_int n_query_rows, \\ Mvalue_int k, \\ const Mvalue_idx* R_knn_inds, \\ const Mvalue_t* R_knn_dists, \\ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \\ Mvalue_idx* inds, \\ Mvalue_t* dists, \\ float weight, \\ Mvalue_int* dists_counter) """ macro_pass_two = """ #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( \\ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \\ template void \\ raft::spatial::knn::detail::rbc_low_dim_pass_two<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \\ raft::resources const& handle, \\ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \\ const Mvalue_t* query, \\ const Mvalue_int n_query_rows, \\ Mvalue_int k, \\ const Mvalue_idx* R_knn_inds, \\ const Mvalue_t* R_knn_dists, \\ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \\ Mvalue_idx* inds, \\ Mvalue_t* dists, \\ float weight, \\ Mvalue_int* dists_counter) """ distances = dict( haversine="raft::spatial::knn::detail::HaversineFunc", euclidean="raft::spatial::knn::detail::EuclideanFunc", dist="raft::spatial::knn::detail::DistFunc", ) for k, v in distances.items(): for dim in [2, 3]: path = f"registers_pass_one_{dim}d_{k}.cu" with open(path, "w") as f: f.write(header) f.write(macro_pass_one) f.write(f"instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one(\n") f.write(f" std::int64_t, float, std::uint32_t, {dim}, {v});\n") f.write("#undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_one\n") print(f"src/spatial/knn/detail/ball_cover/{path}") for k, v in distances.items(): for dim in [2, 3]: path = f"registers_pass_two_{dim}d_{k}.cu" with open(path, "w") as f: f.write(header) f.write(macro_pass_two) f.write(f"instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two(\n") f.write(f" std::int64_t, float, std::uint32_t, {dim}, {v});\n") f.write("#undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two\n") print(f"src/spatial/knn/detail/ball_cover/{path}")
0
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail
rapidsai_public_repos/raft/cpp/src/spatial/knn/detail/ball_cover/registers_pass_two_3d_haversine.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by registers_00_generate.py * * Make changes there and run in this directory: * * > python registers_00_generate.py * */ #include <cstdint> // int64_t #include <raft/spatial/knn/detail/ball_cover/registers-inl.cuh> #define instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( \ Mvalue_idx, Mvalue_t, Mvalue_int, Mdims, Mdist_func) \ template void \ raft::spatial::knn::detail::rbc_low_dim_pass_two<Mvalue_idx, Mvalue_t, Mvalue_int, Mdims>( \ raft::resources const& handle, \ const BallCoverIndex<Mvalue_idx, Mvalue_t, Mvalue_int>& index, \ const Mvalue_t* query, \ const Mvalue_int n_query_rows, \ Mvalue_int k, \ const Mvalue_idx* R_knn_inds, \ const Mvalue_t* R_knn_dists, \ Mdist_func<Mvalue_t, Mvalue_int>& dfunc, \ Mvalue_idx* inds, \ Mvalue_t* dists, \ float weight, \ Mvalue_int* dists_counter) instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two( std::int64_t, float, std::uint32_t, 3, raft::spatial::knn::detail::HaversineFunc); #undef instantiate_raft_spatial_knn_detail_rbc_low_dim_pass_two
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/distance/distance.cu
/* * Copyright (c) 2018-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/distance/detail/kernels/rbf_fin_op.cuh> // rbf_fin_op #include <raft/distance/distance-inl.cuh> /* * Hierarchy of instantiations: * * This file defines the template instantiations for the public API of * raft::distance. To improve compile times, the compilation of the distance * kernels is handled in distance/detail/pairwise_matrix/dispatch_*.cu. * */ #define instantiate_raft_distance_distance(DT, DataT, AccT, OutT, FinalLambda, IdxT) \ template void raft::distance::distance<DT, DataT, AccT, OutT, FinalLambda, IdxT>( \ raft::resources const& handle, \ const DataT* x, \ const DataT* y, \ OutT* dist, \ IdxT m, \ IdxT n, \ IdxT k, \ void* workspace, \ size_t worksize, \ FinalLambda fin_op, \ bool isRowMajor, \ DataT metric_arg) // The following two instances are used in test/distance/gram.cu. Note the use // of int64_t for the index type. instantiate_raft_distance_distance(raft::distance::DistanceType::L2Unexpanded, float, float, float, raft::distance::kernels::detail::rbf_fin_op<float>, int64_t); instantiate_raft_distance_distance(raft::distance::DistanceType::L2Unexpanded, double, double, double, raft::distance::kernels::detail::rbf_fin_op<double>, int64_t); instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CorrelationExpanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance(raft::distance::DistanceType::CorrelationExpanded, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CosineExpanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CosineExpanded, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HammingUnexpanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HammingUnexpanded, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HellingerExpanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HellingerExpanded, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::InnerProduct, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::InnerProduct, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::JensenShannon, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::JensenShannon, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::KLDivergence, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::KLDivergence, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L1, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L1, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtExpanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtExpanded, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtUnexpanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtUnexpanded, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Unexpanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Unexpanded, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Linf, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Linf, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::LpUnexpanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::LpUnexpanded, double, double, double, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::RusselRaoExpanded, float, float, float, raft::identity_op, int); instantiate_raft_distance_distance( raft::distance::DistanceType::RusselRaoExpanded, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_distance // Same, but without raft::identity_op #define instantiate_raft_distance_distance(DT, DataT, AccT, OutT, IdxT) \ template void raft::distance::distance<DT, DataT, AccT, OutT, IdxT>( \ raft::resources const& handle, \ const DataT* x, \ const DataT* y, \ OutT* dist, \ IdxT m, \ IdxT n, \ IdxT k, \ void* workspace, \ size_t worksize, \ bool isRowMajor, \ DataT metric_arg) instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CorrelationExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CorrelationExpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CosineExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CosineExpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HammingUnexpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HammingUnexpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HellingerExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HellingerExpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::InnerProduct, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::InnerProduct, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::JensenShannon, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::JensenShannon, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::KLDivergence, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::KLDivergence, double, double, double, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L1, float, float, float, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L1, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtExpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtUnexpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtUnexpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Unexpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Unexpanded, double, double, double, int); instantiate_raft_distance_distance(raft::distance::DistanceType::Linf, float, float, float, int); instantiate_raft_distance_distance(raft::distance::DistanceType::Linf, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::LpUnexpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::LpUnexpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::RusselRaoExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::RusselRaoExpanded, double, double, double, int); #undef instantiate_raft_distance_distance // Same, but without workspace #define instantiate_raft_distance_distance(DT, DataT, AccT, OutT, IdxT) \ template void raft::distance::distance<DT, DataT, AccT, OutT, IdxT>( \ raft::resources const& handle, \ const DataT* x, \ const DataT* y, \ OutT* dist, \ IdxT m, \ IdxT n, \ IdxT k, \ bool isRowMajor, \ DataT metric_arg) instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CorrelationExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CorrelationExpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CosineExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::CosineExpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HammingUnexpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HammingUnexpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HellingerExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::HellingerExpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::InnerProduct, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::InnerProduct, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::JensenShannon, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::JensenShannon, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::KLDivergence, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::KLDivergence, double, double, double, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L1, float, float, float, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L1, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtExpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtUnexpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2SqrtUnexpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Unexpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Unexpanded, double, double, double, int); instantiate_raft_distance_distance(raft::distance::DistanceType::Linf, float, float, float, int); instantiate_raft_distance_distance(raft::distance::DistanceType::Linf, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::LpUnexpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::LpUnexpanded, double, double, double, int); instantiate_raft_distance_distance( raft::distance::DistanceType::RusselRaoExpanded, float, float, float, int); instantiate_raft_distance_distance( raft::distance::DistanceType::RusselRaoExpanded, double, double, double, int); #undef instantiate_raft_distance_distance #define instantiate_raft_distance_getWorkspaceSize(DistT, DataT, AccT, OutT, IdxT) \ template size_t raft::distance::getWorkspaceSize<DistT, DataT, AccT, OutT, IdxT>( \ const DataT* x, const DataT* y, IdxT m, IdxT n, IdxT k) instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::Canberra, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::Canberra, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::CorrelationExpanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::CorrelationExpanded, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::CosineExpanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::CosineExpanded, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::HammingUnexpanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::HammingUnexpanded, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::HellingerExpanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::HellingerExpanded, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::InnerProduct, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::InnerProduct, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::JensenShannon, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::JensenShannon, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::KLDivergence, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::KLDivergence, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L1, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L1, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Expanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Expanded, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2SqrtExpanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2SqrtExpanded, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2SqrtUnexpanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2SqrtUnexpanded, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Unexpanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Unexpanded, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::Linf, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::Linf, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::LpUnexpanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::LpUnexpanded, double, double, double, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::RusselRaoExpanded, float, float, float, int); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::RusselRaoExpanded, double, double, double, int); #undef instantiate_raft_distance_getWorkspaceSize #define instantiate_raft_distance_getWorkspaceSize(DistT, DataT, AccT, OutT, IdxT, layout) \ template size_t raft::distance::getWorkspaceSize<DistT, DataT, AccT, OutT, IdxT, layout>( \ raft::device_matrix_view<DataT, IdxT, layout> const& x, \ raft::device_matrix_view<DataT, IdxT, layout> const& y) // We could consider not taking template parameters for this function. The // number of instantiations seems a bit excessive.. instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::Canberra, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::Canberra, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::Canberra, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::Canberra, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::CorrelationExpanded, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::CorrelationExpanded, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::CorrelationExpanded, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::CorrelationExpanded, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::CosineExpanded, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::CosineExpanded, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::CosineExpanded, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::CosineExpanded, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::HammingUnexpanded, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::HammingUnexpanded, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::HammingUnexpanded, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::HammingUnexpanded, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::HellingerExpanded, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::HellingerExpanded, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::HellingerExpanded, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::HellingerExpanded, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::InnerProduct, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::InnerProduct, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::InnerProduct, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::InnerProduct, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::JensenShannon, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::JensenShannon, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::JensenShannon, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::JensenShannon, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::KLDivergence, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::KLDivergence, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::KLDivergence, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::KLDivergence, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L1, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L1, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L1, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L1, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Expanded, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Expanded, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Expanded, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Expanded, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::L2SqrtExpanded, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::L2SqrtExpanded, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::L2SqrtExpanded, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::L2SqrtExpanded, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::L2SqrtUnexpanded, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::L2SqrtUnexpanded, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::L2SqrtUnexpanded, float, float, float, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::L2SqrtUnexpanded, double, double, double, int, raft::layout_f_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Unexpanded, float, float, float, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize(raft::distance::DistanceType::L2Unexpanded, double, double, double, int, raft::layout_c_contiguous); instantiate_raft_distance_getWorkspaceSize( raft::distance::DistanceType::L2Unexpanded, float, float, float, int, raft::layout_f_contiguous); #undef instantiate_raft_distance_getWorkspaceSize #define instantiate_raft_distance_pairwise_distance(DataT, IdxT) \ template void raft::distance::pairwise_distance(raft::resources const& handle, \ const DataT* x, \ const DataT* y, \ DataT* dist, \ IdxT m, \ IdxT n, \ IdxT k, \ rmm::device_uvector<char>& workspace, \ raft::distance::DistanceType metric, \ bool isRowMajor, \ DataT metric_arg) instantiate_raft_distance_pairwise_distance(float, int); instantiate_raft_distance_pairwise_distance(double, int); #undef instantiate_raft_distance_pairwise_distance // Same, but without workspace #define instantiate_raft_distance_pairwise_distance(DataT, IdxT) \ template void raft::distance::pairwise_distance(raft::resources const& handle, \ const DataT* x, \ const DataT* y, \ DataT* dist, \ IdxT m, \ IdxT n, \ IdxT k, \ raft::distance::DistanceType metric, \ bool isRowMajor, \ DataT metric_arg) instantiate_raft_distance_pairwise_distance(float, int); instantiate_raft_distance_pairwise_distance(double, int); #undef instantiate_raft_distance_pairwise_distance // Version with mdspan #define instantiate_raft_distance_distance(DistT, DataT, AccT, OutT, layout, IdxT) \ template void raft::distance::distance<DistT, DataT, AccT, OutT, layout, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<DataT, IdxT, layout> const x, \ raft::device_matrix_view<DataT, IdxT, layout> const y, \ raft::device_matrix_view<OutT, IdxT, layout> dist, \ DataT metric_arg) // Again, we might want to consider reigning in the number of instantiations... instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Canberra, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::CorrelationExpanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::CorrelationExpanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::CorrelationExpanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::CorrelationExpanded, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::CosineExpanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::CosineExpanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::CosineExpanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::CosineExpanded, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::HammingUnexpanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::HammingUnexpanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::HammingUnexpanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::HammingUnexpanded, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::HellingerExpanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::HellingerExpanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::HellingerExpanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::HellingerExpanded, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::InnerProduct, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::InnerProduct, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::InnerProduct, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::InnerProduct, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::JensenShannon, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::JensenShannon, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::JensenShannon, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::JensenShannon, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::KLDivergence, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::KLDivergence, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::KLDivergence, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::KLDivergence, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L1, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L1, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L1, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L1, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Expanded, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2SqrtExpanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2SqrtExpanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2SqrtExpanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2SqrtExpanded, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2SqrtUnexpanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2SqrtUnexpanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2SqrtUnexpanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2SqrtUnexpanded, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Unexpanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2Unexpanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::L2Unexpanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::L2Unexpanded, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Linf, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Linf, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Linf, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::Linf, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::LpUnexpanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::LpUnexpanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance( raft::distance::DistanceType::LpUnexpanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::LpUnexpanded, double, double, double, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::RusselRaoExpanded, float, float, float, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::RusselRaoExpanded, double, double, double, raft::layout_c_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::RusselRaoExpanded, float, float, float, raft::layout_f_contiguous, int); instantiate_raft_distance_distance(raft::distance::DistanceType::RusselRaoExpanded, double, double, double, raft::layout_f_contiguous, int); #undef instantiate_raft_distance_distance #define instantiate_raft_distance_pairwise_distance(DataT, layout, IdxT) \ template void raft::distance::pairwise_distance( \ raft::resources const& handle, \ raft::device_matrix_view<DataT, IdxT, layout> const x, \ raft::device_matrix_view<DataT, IdxT, layout> const y, \ raft::device_matrix_view<DataT, IdxT, layout> dist, \ raft::distance::DistanceType metric, \ DataT metric_arg) instantiate_raft_distance_pairwise_distance(float, raft::layout_c_contiguous, int); instantiate_raft_distance_pairwise_distance(float, raft::layout_f_contiguous, int); instantiate_raft_distance_pairwise_distance(double, raft::layout_c_contiguous, int); instantiate_raft_distance_pairwise_distance(double, raft::layout_f_contiguous, int); #undef instantiate_raft_distance_pairwise_distance
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/distance/fused_l2_nn.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cstdint> // int64_t #include <raft/core/kvp.hpp> // raft::KeyValuePair #include <raft/distance/fused_l2_nn-inl.cuh> #define instantiate_raft_distance_fusedL2NNMinReduce(DataT, OutT, IdxT) \ template void raft::distance::fusedL2NNMinReduce<DataT, OutT, IdxT>(OutT * min, \ const DataT* x, \ const DataT* y, \ const DataT* xn, \ const DataT* yn, \ IdxT m, \ IdxT n, \ IdxT k, \ void* workspace, \ bool sqrt, \ bool initOutBuffer, \ cudaStream_t stream) instantiate_raft_distance_fusedL2NNMinReduce(double, double, int); instantiate_raft_distance_fusedL2NNMinReduce(double, double, int64_t); instantiate_raft_distance_fusedL2NNMinReduce(float, float, int); instantiate_raft_distance_fusedL2NNMinReduce(float, float, int64_t); // We can't have comma's in the macro expansion, so we use the COMMA macro: #define COMMA , instantiate_raft_distance_fusedL2NNMinReduce(double, raft::KeyValuePair<int COMMA double>, int); instantiate_raft_distance_fusedL2NNMinReduce(double, raft::KeyValuePair<int64_t COMMA double>, int64_t); instantiate_raft_distance_fusedL2NNMinReduce(float, raft::KeyValuePair<int COMMA float>, int); instantiate_raft_distance_fusedL2NNMinReduce(float, raft::KeyValuePair<int64_t COMMA float>, int64_t); #undef COMMA #undef instantiate_raft_distance_fusedL2NNMinReduce
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::lp_unexp_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::hamming_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_rbf.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/kernels/rbf_fin_op.cuh> // rbf_fin_op #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l2_unexp_distance_op, float, float, float, raft::distance::kernels::detail::rbf_fin_op<float>, int64_t); instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l2_unexp_distance_op, double, double, double, raft::distance::kernels::detail::rbf_fin_op<double>, int64_t); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_l1_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l1_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_cosine_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #include <raft/distance/detail/pairwise_matrix/dispatch_sm80.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::cosine_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_lp_unexpanded_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::lp_unexp_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_canberra_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::canberra_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_russel_rao_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::russel_rao_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_russel_rao_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::russel_rao_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_l2_expanded_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #include <raft/distance/detail/pairwise_matrix/dispatch_sm80.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l2_exp_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_hamming_unexpanded_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::hamming_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_l1_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l1_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::hellinger_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_l2_expanded_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #include <raft/distance/detail/pairwise_matrix/dispatch_sm80.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l2_exp_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_kl_divergence_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::kl_divergence_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_correlation_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::correlation_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_00_generate.py
# Copyright (c) 2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # NOTE: this template is not perfectly formatted. Use pre-commit to get # everything in shape again. header = """/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch """ macro = """ #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \\ OpT, DataT, AccT, OutT, FinOpT, IdxT) \\ template void raft::distance::detail:: \\ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \\ OpT<DataT, AccT, IdxT> distance_op, \\ IdxT m, \\ IdxT n, \\ IdxT k, \\ const DataT* x, \\ const DataT* y, \\ const DataT* x_norm, \\ const DataT* y_norm, \\ OutT* out, \\ FinOpT fin_op, \\ cudaStream_t stream, \\ bool is_row_major) """ data_type_instances = [ dict( DataT="float", AccT="float", OutT="float", IdxT="int", ), dict( DataT="double", AccT="double", OutT="double", IdxT="int", ), ] op_instances = [ dict( path_prefix="canberra", OpT="raft::distance::detail::ops::canberra_distance_op", archs = [60], ), dict( path_prefix="correlation", OpT="raft::distance::detail::ops::correlation_distance_op", archs = [60], ), dict( path_prefix="cosine", OpT="raft::distance::detail::ops::cosine_distance_op", archs = [60, 80], ), dict( path_prefix="hamming_unexpanded", OpT="raft::distance::detail::ops::hamming_distance_op", archs = [60], ), dict( path_prefix="hellinger_expanded", OpT="raft::distance::detail::ops::hellinger_distance_op", archs = [60], ), # inner product is handled by cublas. dict( path_prefix="jensen_shannon", OpT="raft::distance::detail::ops::jensen_shannon_distance_op", archs = [60], ), dict( path_prefix="kl_divergence", OpT="raft::distance::detail::ops::kl_divergence_op", archs = [60], ), dict( path_prefix="l1", OpT="raft::distance::detail::ops::l1_distance_op", archs = [60], ), dict( path_prefix="l2_expanded", OpT="raft::distance::detail::ops::l2_exp_distance_op", archs = [60, 80], ), dict( path_prefix="l2_unexpanded", OpT="raft::distance::detail::ops::l2_unexp_distance_op", archs = [60], ), dict( path_prefix="l_inf", OpT="raft::distance::detail::ops::l_inf_distance_op", archs = [60], ), dict( path_prefix="lp_unexpanded", OpT="raft::distance::detail::ops::lp_unexp_distance_op", archs = [60], ), dict( path_prefix="russel_rao", OpT="raft::distance::detail::ops::russel_rao_distance_op", archs = [60], ), ] def arch_headers(archs): include_headers ="\n".join([ f"#include <raft/distance/detail/pairwise_matrix/dispatch_sm{arch}.cuh>" for arch in archs ]) return include_headers for op in op_instances: for dt in data_type_instances: DataT, AccT, OutT, IdxT = (dt[k] for k in ["DataT", "AccT", "OutT", "IdxT"]); path = f"dispatch_{op['path_prefix']}_{DataT}_{AccT}_{OutT}_{IdxT}.cu" with open(path, "w") as f: f.write(header) f.write(arch_headers(op["archs"])) f.write(macro) OpT = op['OpT'] FinOpT = "raft::identity_op" f.write(f"\ninstantiate_raft_distance_detail_pairwise_matrix_dispatch({OpT}, {DataT}, {AccT}, {OutT}, {FinOpT}, {IdxT});\n") f.write("\n#undef instantiate_raft_distance_detail_pairwise_matrix_dispatch\n") print(f"src/distance/detail/pairwise_matrix/{path}") # Dispatch kernels for with the RBF fin op. with open("dispatch_rbf.cu", "w") as f: OpT="raft::distance::detail::ops::l2_unexp_distance_op" archs = [60] f.write(header) f.write("#include <raft/distance/detail/kernels/rbf_fin_op.cuh> // rbf_fin_op\n") f.write(arch_headers(archs)) f.write(macro) for dt in data_type_instances: DataT, AccT, OutT, IdxT = (dt[k] for k in ["DataT", "AccT", "OutT", "IdxT"]); IdxT = "int64_t" # overwrite IdxT FinOpT = f"raft::distance::kernels::detail::rbf_fin_op<{DataT}>" f.write(f"\ninstantiate_raft_distance_detail_pairwise_matrix_dispatch({OpT}, {DataT}, {AccT}, {OutT}, {FinOpT}, {IdxT});\n") f.write("\n#undef instantiate_raft_distance_detail_pairwise_matrix_dispatch\n") print("src/distance/detail/pairwise_matrix/dispatch_rbf.cu")
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_cosine_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #include <raft/distance/detail/pairwise_matrix/dispatch_sm80.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::cosine_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l2_unexp_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_correlation_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::correlation_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_canberra_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::canberra_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_hellinger_expanded_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::hellinger_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_l2_unexpanded_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l2_unexp_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::jensen_shannon_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_kl_divergence_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::kl_divergence_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_jensen_shannon_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::jensen_shannon_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_l_inf_float_float_float_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l_inf_distance_op, float, float, float, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src/distance/detail
rapidsai_public_repos/raft/cpp/src/distance/detail/pairwise_matrix/dispatch_l_inf_double_double_double_int.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by dispatch_00_generate.py * * Make changes there and run in this directory: * * > python dispatch_00_generate.py * */ #include <raft/core/operators.hpp> // raft::identity_op #include <raft/distance/detail/distance_ops/all_ops.cuh> // ops::* #include <raft/distance/detail/pairwise_matrix/dispatch-inl.cuh> // dispatch #include <raft/distance/detail/pairwise_matrix/dispatch_sm60.cuh> #define instantiate_raft_distance_detail_pairwise_matrix_dispatch( \ OpT, DataT, AccT, OutT, FinOpT, IdxT) \ template void raft::distance::detail:: \ pairwise_matrix_dispatch<OpT<DataT, AccT, IdxT>, DataT, AccT, OutT, FinOpT, IdxT>( \ OpT<DataT, AccT, IdxT> distance_op, \ IdxT m, \ IdxT n, \ IdxT k, \ const DataT* x, \ const DataT* y, \ const DataT* x_norm, \ const DataT* y_norm, \ OutT* out, \ FinOpT fin_op, \ cudaStream_t stream, \ bool is_row_major) instantiate_raft_distance_detail_pairwise_matrix_dispatch( raft::distance::detail::ops::l_inf_distance_op, double, double, double, raft::identity_op, int); #undef instantiate_raft_distance_detail_pairwise_matrix_dispatch
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_build_float_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> #define instantiate_raft_neighbors_ivf_flat_build(T, IdxT) \ template auto raft::neighbors::ivf_flat::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ const T* dataset, \ IdxT n_rows, \ uint32_t dim) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template auto raft::neighbors::ivf_flat::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template void raft::neighbors::ivf_flat::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset, \ raft::neighbors::ivf_flat::index<T, IdxT>& idx); instantiate_raft_neighbors_ivf_flat_build(float, int64_t); #undef instantiate_raft_neighbors_ivf_flat_build
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ball_cover.cu
/* * Copyright (c) 2021-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cstdint> #include <raft/neighbors/ball_cover-inl.cuh> #define instantiate_raft_neighbors_ball_cover(idx_t, value_t, int_t, matrix_idx_t) \ template void raft::neighbors::ball_cover::build_index<idx_t, value_t, int_t, matrix_idx_t>( \ raft::resources const& handle, \ raft::neighbors::ball_cover::BallCoverIndex<idx_t, value_t, int_t, matrix_idx_t>& index); \ \ template void raft::neighbors::ball_cover::all_knn_query<idx_t, value_t, int_t, matrix_idx_t>( \ raft::resources const& handle, \ raft::neighbors::ball_cover::BallCoverIndex<idx_t, value_t, int_t, matrix_idx_t>& index, \ int_t k, \ idx_t* inds, \ value_t* dists, \ bool perform_post_filtering, \ float weight); \ \ template void raft::neighbors::ball_cover::all_knn_query<idx_t, value_t, int_t, matrix_idx_t>( \ raft::resources const& handle, \ raft::neighbors::ball_cover::BallCoverIndex<idx_t, value_t, int_t, matrix_idx_t>& index, \ raft::device_matrix_view<idx_t, matrix_idx_t, row_major> inds, \ raft::device_matrix_view<value_t, matrix_idx_t, row_major> dists, \ int_t k, \ bool perform_post_filtering, \ float weight); \ \ template void raft::neighbors::ball_cover::knn_query<idx_t, value_t, int_t>( \ raft::resources const& handle, \ const raft::neighbors::ball_cover::BallCoverIndex<idx_t, value_t, int_t>& index, \ int_t k, \ const value_t* query, \ int_t n_query_pts, \ idx_t* inds, \ value_t* dists, \ bool perform_post_filtering, \ float weight); \ \ template void raft::neighbors::ball_cover::knn_query<idx_t, value_t, int_t, matrix_idx_t>( \ raft::resources const& handle, \ const raft::neighbors::ball_cover::BallCoverIndex<idx_t, value_t, int_t, matrix_idx_t>& index, \ raft::device_matrix_view<const value_t, matrix_idx_t, row_major> query, \ raft::device_matrix_view<idx_t, matrix_idx_t, row_major> inds, \ raft::device_matrix_view<value_t, matrix_idx_t, row_major> dists, \ int_t k, \ bool perform_post_filtering, \ float weight); instantiate_raft_neighbors_ball_cover(int64_t, float, uint32_t, uint32_t); #undef instantiate_raft_neighbors_ball_cover
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_build_int8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> #define instantiate_raft_neighbors_ivf_flat_build(T, IdxT) \ template auto raft::neighbors::ivf_flat::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ const T* dataset, \ IdxT n_rows, \ uint32_t dim) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template auto raft::neighbors::ivf_flat::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template void raft::neighbors::ivf_flat::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset, \ raft::neighbors::ivf_flat::index<T, IdxT>& idx); instantiate_raft_neighbors_ivf_flat_build(int8_t, int64_t); #undef instantiate_raft_neighbors_ivf_flat_build
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivfpq_build_float_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq-inl.cuh> #include <raft/neighbors/ivf_pq_types.hpp> // raft::neighbors::ivf_pq::index #define instantiate_raft_neighbors_ivf_pq_build(T, IdxT) \ template raft::neighbors::ivf_pq::index<IdxT> raft::neighbors::ivf_pq::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset); \ \ template auto raft::neighbors::ivf_pq::build( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::index_params& params, \ const T* dataset, \ IdxT n_rows, \ uint32_t dim) \ ->raft::neighbors::ivf_pq::index<IdxT>; instantiate_raft_neighbors_ivf_pq_build(float, int64_t); #undef instantiate_raft_neighbors_ivf_pq_build
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/refine_uint8_t_float.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by refine_00_generate.py * * Make changes there and run in this directory: * * > python refine_00_generate.py * */ #include <raft/neighbors/refine-inl.cuh> #define instantiate_raft_neighbors_refine(idx_t, data_t, distance_t, matrix_idx) \ template void raft::neighbors::refine<idx_t, data_t, distance_t, matrix_idx>( \ raft::resources const& handle, \ raft::device_matrix_view<const data_t, matrix_idx, row_major> dataset, \ raft::device_matrix_view<const data_t, matrix_idx, row_major> queries, \ raft::device_matrix_view<const idx_t, matrix_idx, row_major> neighbor_candidates, \ raft::device_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::device_matrix_view<distance_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric); \ \ template void raft::neighbors::refine<idx_t, data_t, distance_t, matrix_idx>( \ raft::resources const& handle, \ raft::host_matrix_view<const data_t, matrix_idx, row_major> dataset, \ raft::host_matrix_view<const data_t, matrix_idx, row_major> queries, \ raft::host_matrix_view<const idx_t, matrix_idx, row_major> neighbor_candidates, \ raft::host_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::host_matrix_view<distance_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric); instantiate_raft_neighbors_refine(int64_t, uint8_t, float, int64_t); #undef instantiate_raft_neighbors_refine
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivfpq_search_float_int64_t.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq-inl.cuh> #include <raft/neighbors/ivf_pq_types.hpp> // raft::neighbors::ivf_pq::index #define instantiate_raft_neighbors_ivf_pq_search(T, IdxT) \ template void raft::neighbors::ivf_pq::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::search_params& params, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ raft::device_matrix_view<const T, uint32_t, row_major> queries, \ raft::device_matrix_view<IdxT, uint32_t, row_major> neighbors, \ raft::device_matrix_view<float, uint32_t, row_major> distances); \ \ template void raft::neighbors::ivf_pq::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::search_params& params, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ const T* queries, \ uint32_t n_queries, \ uint32_t k, \ IdxT* neighbors, \ float* distances, \ rmm::mr::device_memory_resource* mr) instantiate_raft_neighbors_ivf_pq_search(float, int64_t); #undef instantiate_raft_neighbors_ivf_pq_search
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/refine_float_float.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by refine_00_generate.py * * Make changes there and run in this directory: * * > python refine_00_generate.py * */ #include <raft/neighbors/refine-inl.cuh> #define instantiate_raft_neighbors_refine(idx_t, data_t, distance_t, matrix_idx) \ template void raft::neighbors::refine<idx_t, data_t, distance_t, matrix_idx>( \ raft::resources const& handle, \ raft::device_matrix_view<const data_t, matrix_idx, row_major> dataset, \ raft::device_matrix_view<const data_t, matrix_idx, row_major> queries, \ raft::device_matrix_view<const idx_t, matrix_idx, row_major> neighbor_candidates, \ raft::device_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::device_matrix_view<distance_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric); \ \ template void raft::neighbors::refine<idx_t, data_t, distance_t, matrix_idx>( \ raft::resources const& handle, \ raft::host_matrix_view<const data_t, matrix_idx, row_major> dataset, \ raft::host_matrix_view<const data_t, matrix_idx, row_major> queries, \ raft::host_matrix_view<const idx_t, matrix_idx, row_major> neighbor_candidates, \ raft::host_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::host_matrix_view<distance_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric); instantiate_raft_neighbors_refine(int64_t, float, float, int64_t); #undef instantiate_raft_neighbors_refine
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivfpq_search_uint8_t_int64_t.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq-inl.cuh> #include <raft/neighbors/ivf_pq_types.hpp> // raft::neighbors::ivf_pq::index #define instantiate_raft_neighbors_ivf_pq_search(T, IdxT) \ template void raft::neighbors::ivf_pq::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::search_params& params, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ raft::device_matrix_view<const T, uint32_t, row_major> queries, \ raft::device_matrix_view<IdxT, uint32_t, row_major> neighbors, \ raft::device_matrix_view<float, uint32_t, row_major> distances); \ \ template void raft::neighbors::ivf_pq::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::search_params& params, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ const T* queries, \ uint32_t n_queries, \ uint32_t k, \ IdxT* neighbors, \ float* distances, \ rmm::mr::device_memory_resource* mr) instantiate_raft_neighbors_ivf_pq_search(uint8_t, int64_t); #undef instantiate_raft_neighbors_ivf_pq_search
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_extend_uint8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> #define instantiate_raft_neighbors_ivf_flat_extend(T, IdxT) \ template auto raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index<T, IdxT>& orig_index, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template auto raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \ const raft::neighbors::ivf_flat::index<T, IdxT>& orig_index) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template void raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ raft::neighbors::ivf_flat::index<T, IdxT>* index, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows); \ \ template void raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \ raft::neighbors::ivf_flat::index<T, IdxT>* index); instantiate_raft_neighbors_ivf_flat_extend(uint8_t, int64_t); #undef instantiate_raft_neighbors_ivf_flat_extend
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_search_uint8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> #define instantiate_raft_neighbors_ivf_flat_search(T, IdxT) \ template void raft::neighbors::ivf_flat::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::search_params& params, \ const raft::neighbors::ivf_flat::index<T, IdxT>& index, \ const T* queries, \ uint32_t n_queries, \ uint32_t k, \ IdxT* neighbors, \ float* distances, \ rmm::mr::device_memory_resource* mr); \ \ template void raft::neighbors::ivf_flat::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::search_params& params, \ const raft::neighbors::ivf_flat::index<T, IdxT>& index, \ raft::device_matrix_view<const T, IdxT, row_major> queries, \ raft::device_matrix_view<IdxT, IdxT, row_major> neighbors, \ raft::device_matrix_view<float, IdxT, row_major> distances); instantiate_raft_neighbors_ivf_flat_search(uint8_t, int64_t); #undef instantiate_raft_neighbors_ivf_flat_search
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_build_uint8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> #define instantiate_raft_neighbors_ivf_flat_build(T, IdxT) \ template auto raft::neighbors::ivf_flat::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ const T* dataset, \ IdxT n_rows, \ uint32_t dim) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template auto raft::neighbors::ivf_flat::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template void raft::neighbors::ivf_flat::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset, \ raft::neighbors::ivf_flat::index<T, IdxT>& idx); instantiate_raft_neighbors_ivf_flat_build(uint8_t, int64_t); #undef instantiate_raft_neighbors_ivf_flat_build
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/brute_force_knn_index_float.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <cstdint> #include <raft/neighbors/brute_force-inl.cuh> template void raft::neighbors::brute_force::search<float, int>( raft::resources const& res, const raft::neighbors::brute_force::index<float>& idx, raft::device_matrix_view<const float, int64_t, row_major> queries, raft::device_matrix_view<int, int64_t, row_major> neighbors, raft::device_matrix_view<float, int64_t, row_major> distances); template void raft::neighbors::brute_force::search<float, int64_t>( raft::resources const& res, const raft::neighbors::brute_force::index<float>& idx, raft::device_matrix_view<const float, int64_t, row_major> queries, raft::device_matrix_view<int64_t, int64_t, row_major> neighbors, raft::device_matrix_view<float, int64_t, row_major> distances); template raft::neighbors::brute_force::index<float> raft::neighbors::brute_force::build<float>( raft::resources const& res, raft::device_matrix_view<const float, int64_t, row_major> dataset, raft::distance::DistanceType metric, float metric_arg);
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivfpq_build_uint8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq-inl.cuh> #include <raft/neighbors/ivf_pq_types.hpp> // raft::neighbors::ivf_pq::index #define instantiate_raft_neighbors_ivf_pq_build(T, IdxT) \ template raft::neighbors::ivf_pq::index<IdxT> raft::neighbors::ivf_pq::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset); \ \ template auto raft::neighbors::ivf_pq::build( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::index_params& params, \ const T* dataset, \ IdxT n_rows, \ uint32_t dim) \ ->raft::neighbors::ivf_pq::index<IdxT>; instantiate_raft_neighbors_ivf_pq_build(uint8_t, int64_t); #undef instantiate_raft_neighbors_ivf_pq_build
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/brute_force_00_generate.py
# Copyright (c) 2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. header = """ /* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by brute_force_00_generate.py * * Make changes there and run in this directory: * * > python brute_force_00_generate.py * */ #include <cstdint> #include <raft/neighbors/brute_force-inl.cuh> """ knn_macro = """ #define instantiate_raft_neighbors_brute_force_knn(idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op) \\ template void raft::neighbors::brute_force::knn<idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op>( \\ raft::resources const& handle, \\ std::vector<raft::device_matrix_view<const value_t, matrix_idx, index_layout>> index, \\ raft::device_matrix_view<const value_t, matrix_idx, search_layout> search, \\ raft::device_matrix_view<idx_t, matrix_idx, row_major> indices, \\ raft::device_matrix_view<value_t, matrix_idx, row_major> distances, \\ raft::distance::DistanceType metric, \\ std::optional<float> metric_arg, \\ std::optional<idx_t> global_id_offset, \\ epilogue_op distance_epilogue); """ fused_l2_knn_macro = """ #define instantiate_raft_neighbors_brute_force_fused_l2_knn(value_t, idx_t, idx_layout, query_layout) \\ template void raft::neighbors::brute_force::fused_l2_knn( \\ raft::resources const& handle, \\ raft::device_matrix_view<const value_t, idx_t, idx_layout> index, \\ raft::device_matrix_view<const value_t, idx_t, query_layout> query, \\ raft::device_matrix_view<idx_t, idx_t, row_major> out_inds, \\ raft::device_matrix_view<value_t, idx_t, row_major> out_dists, \\ raft::distance::DistanceType metric); """ knn_types = dict( int64_t_float_uint32_t=("int64_t","float","uint32_t"), int64_t_float_int64_t=("int64_t","float","int64_t"), int_float_int=("int","float","int"), uint32_t_float_uint32_t=("uint32_t","float","uint32_t"), ) fused_l2_knn_types = dict( float_int64_t=("float", "int64_t"), ) # knn for type_path, (idx_t, value_t, matrix_idx) in knn_types.items(): path = f"brute_force_knn_{type_path}.cu" with open(path, "w") as f: f.write(header) f.write(knn_macro) f.write(f"instantiate_raft_neighbors_brute_force_knn({idx_t},{value_t},{matrix_idx},raft::row_major,raft::row_major,raft::identity_op);\n\n") f.write("#undef instantiate_raft_neighbors_brute_force_knn\n") # For pasting into CMakeLists.txt print(f"src/neighbors/{path}") #fused_l2_knn for type_path, (value_t, idx_t) in fused_l2_knn_types.items(): path = f"brute_force_fused_l2_knn_{type_path}.cu" with open(path, "w") as f: f.write(header) f.write(fused_l2_knn_macro) f.write(f"instantiate_raft_neighbors_brute_force_fused_l2_knn({value_t},{idx_t},raft::row_major,raft::row_major);\n\n") f.write("#undef instantiate_raft_neighbors_brute_force_fused_l2_knn\n") # For pasting into CMakeLists.txt print(f"src/neighbors/{path}")
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_00_generate.py
# Copyright (c) 2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. header = """/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> """ types = dict( float_int64_t= ("float", "int64_t"), int8_t_int64_t=("int8_t", "int64_t"), uint8_t_int64_t=("uint8_t", "int64_t"), ) build_macro = """ #define instantiate_raft_neighbors_ivf_flat_build(T, IdxT) \\ template auto raft::neighbors::ivf_flat::build<T, IdxT>( \\ raft::resources const& handle, \\ const raft::neighbors::ivf_flat::index_params& params, \\ const T* dataset, \\ IdxT n_rows, \\ uint32_t dim) \\ ->raft::neighbors::ivf_flat::index<T, IdxT>; \\ \\ template auto raft::neighbors::ivf_flat::build<T, IdxT>( \\ raft::resources const& handle, \\ const raft::neighbors::ivf_flat::index_params& params, \\ raft::device_matrix_view<const T, IdxT, row_major> dataset) \\ ->raft::neighbors::ivf_flat::index<T, IdxT>; \\ \\ template void raft::neighbors::ivf_flat::build<T, IdxT>( \\ raft::resources const& handle, \\ const raft::neighbors::ivf_flat::index_params& params, \\ raft::device_matrix_view<const T, IdxT, row_major> dataset, \\ raft::neighbors::ivf_flat::index<T, IdxT>& idx); """ extend_macro = """ #define instantiate_raft_neighbors_ivf_flat_extend(T, IdxT) \\ template auto raft::neighbors::ivf_flat::extend<T, IdxT>( \\ raft::resources const& handle, \\ const raft::neighbors::ivf_flat::index<T, IdxT>& orig_index, \\ const T* new_vectors, \\ const IdxT* new_indices, \\ IdxT n_rows) \\ ->raft::neighbors::ivf_flat::index<T, IdxT>; \\ \\ template auto raft::neighbors::ivf_flat::extend<T, IdxT>( \\ raft::resources const& handle, \\ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \\ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \\ const raft::neighbors::ivf_flat::index<T, IdxT>& orig_index) \\ ->raft::neighbors::ivf_flat::index<T, IdxT>; \\ \\ template void raft::neighbors::ivf_flat::extend<T, IdxT>( \\ raft::resources const& handle, \\ raft::neighbors::ivf_flat::index<T, IdxT>* index, \\ const T* new_vectors, \\ const IdxT* new_indices, \\ IdxT n_rows); \\ \\ template void raft::neighbors::ivf_flat::extend<T, IdxT>( \\ raft::resources const& handle, \\ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \\ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \\ raft::neighbors::ivf_flat::index<T, IdxT>* index); """ search_macro = """ #define instantiate_raft_neighbors_ivf_flat_search(T, IdxT) \\ template void raft::neighbors::ivf_flat::search<T, IdxT>( \\ raft::resources const& handle, \\ const raft::neighbors::ivf_flat::search_params& params, \\ const raft::neighbors::ivf_flat::index<T, IdxT>& index, \\ const T* queries, \\ uint32_t n_queries, \\ uint32_t k, \\ IdxT* neighbors, \\ float* distances, \\ rmm::mr::device_memory_resource* mr ); \\ \\ template void raft::neighbors::ivf_flat::search<T, IdxT>( \\ raft::resources const& handle, \\ const raft::neighbors::ivf_flat::search_params& params, \\ const raft::neighbors::ivf_flat::index<T, IdxT>& index, \\ raft::device_matrix_view<const T, IdxT, row_major> queries, \\ raft::device_matrix_view<IdxT, IdxT, row_major> neighbors, \\ raft::device_matrix_view<float, IdxT, row_major> distances); """ macros = dict( build=dict( definition=build_macro, name="instantiate_raft_neighbors_ivf_flat_build"), extend=dict( definition=extend_macro, name="instantiate_raft_neighbors_ivf_flat_extend"), search=dict( definition=search_macro, name="instantiate_raft_neighbors_ivf_flat_search"), ) for type_path, (T, IdxT) in types.items(): for macro_path, macro in macros.items(): path = f"ivf_flat_{macro_path}_{type_path}.cu" with open(path, "w") as f: f.write(header) f.write(macro['definition']) f.write(f"{macro['name']}({T}, {IdxT});\n\n") f.write(f"#undef {macro['name']}\n") print(f"src/neighbors/{path}")
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/brute_force_knn_int_float_int.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by brute_force_00_generate.py * * Make changes there and run in this directory: * * > python brute_force_00_generate.py * */ #include <cstdint> #include <raft/neighbors/brute_force-inl.cuh> #define instantiate_raft_neighbors_brute_force_knn( \ idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op) \ template void raft::neighbors::brute_force:: \ knn<idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op>( \ raft::resources const& handle, \ std::vector<raft::device_matrix_view<const value_t, matrix_idx, index_layout>> index, \ raft::device_matrix_view<const value_t, matrix_idx, search_layout> search, \ raft::device_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::device_matrix_view<value_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric, \ std::optional<float> metric_arg, \ std::optional<idx_t> global_id_offset, \ epilogue_op distance_epilogue); instantiate_raft_neighbors_brute_force_knn( int, float, int, raft::row_major, raft::row_major, raft::identity_op); #undef instantiate_raft_neighbors_brute_force_knn
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_search_float_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> #define instantiate_raft_neighbors_ivf_flat_search(T, IdxT) \ template void raft::neighbors::ivf_flat::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::search_params& params, \ const raft::neighbors::ivf_flat::index<T, IdxT>& index, \ const T* queries, \ uint32_t n_queries, \ uint32_t k, \ IdxT* neighbors, \ float* distances, \ rmm::mr::device_memory_resource* mr); \ \ template void raft::neighbors::ivf_flat::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::search_params& params, \ const raft::neighbors::ivf_flat::index<T, IdxT>& index, \ raft::device_matrix_view<const T, IdxT, row_major> queries, \ raft::device_matrix_view<IdxT, IdxT, row_major> neighbors, \ raft::device_matrix_view<float, IdxT, row_major> distances); instantiate_raft_neighbors_ivf_flat_search(float, int64_t); #undef instantiate_raft_neighbors_ivf_flat_search
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/brute_force_knn_uint32_t_float_uint32_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by brute_force_00_generate.py * * Make changes there and run in this directory: * * > python brute_force_00_generate.py * */ #include <cstdint> #include <raft/neighbors/brute_force-inl.cuh> #define instantiate_raft_neighbors_brute_force_knn( \ idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op) \ template void raft::neighbors::brute_force:: \ knn<idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op>( \ raft::resources const& handle, \ std::vector<raft::device_matrix_view<const value_t, matrix_idx, index_layout>> index, \ raft::device_matrix_view<const value_t, matrix_idx, search_layout> search, \ raft::device_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::device_matrix_view<value_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric, \ std::optional<float> metric_arg, \ std::optional<idx_t> global_id_offset, \ epilogue_op distance_epilogue); instantiate_raft_neighbors_brute_force_knn( uint32_t, float, uint32_t, raft::row_major, raft::row_major, raft::identity_op); #undef instantiate_raft_neighbors_brute_force_knn
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_search_int8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> #define instantiate_raft_neighbors_ivf_flat_search(T, IdxT) \ template void raft::neighbors::ivf_flat::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::search_params& params, \ const raft::neighbors::ivf_flat::index<T, IdxT>& index, \ const T* queries, \ uint32_t n_queries, \ uint32_t k, \ IdxT* neighbors, \ float* distances, \ rmm::mr::device_memory_resource* mr); \ \ template void raft::neighbors::ivf_flat::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::search_params& params, \ const raft::neighbors::ivf_flat::index<T, IdxT>& index, \ raft::device_matrix_view<const T, IdxT, row_major> queries, \ raft::device_matrix_view<IdxT, IdxT, row_major> neighbors, \ raft::device_matrix_view<float, IdxT, row_major> distances); instantiate_raft_neighbors_ivf_flat_search(int8_t, int64_t); #undef instantiate_raft_neighbors_ivf_flat_search
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivfpq_extend_int8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq-inl.cuh> #include <raft/neighbors/ivf_pq_types.hpp> // raft::neighbors::ivf_pq::index #define instantiate_raft_neighbors_ivf_pq_extend(T, IdxT) \ template raft::neighbors::ivf_pq::index<IdxT> raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT, row_major>> new_indices, \ const raft::neighbors::ivf_pq::index<IdxT>& idx); \ \ template void raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT, row_major>> new_indices, \ raft::neighbors::ivf_pq::index<IdxT>* idx); \ \ template auto raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows) \ ->raft::neighbors::ivf_pq::index<IdxT>; \ \ template void raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ raft::neighbors::ivf_pq::index<IdxT>* idx, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows); instantiate_raft_neighbors_ivf_pq_extend(int8_t, int64_t); #undef instantiate_raft_neighbors_ivf_pq_extend
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/refine_int8_t_float.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by refine_00_generate.py * * Make changes there and run in this directory: * * > python refine_00_generate.py * */ #include <raft/neighbors/refine-inl.cuh> #define instantiate_raft_neighbors_refine(idx_t, data_t, distance_t, matrix_idx) \ template void raft::neighbors::refine<idx_t, data_t, distance_t, matrix_idx>( \ raft::resources const& handle, \ raft::device_matrix_view<const data_t, matrix_idx, row_major> dataset, \ raft::device_matrix_view<const data_t, matrix_idx, row_major> queries, \ raft::device_matrix_view<const idx_t, matrix_idx, row_major> neighbor_candidates, \ raft::device_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::device_matrix_view<distance_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric); \ \ template void raft::neighbors::refine<idx_t, data_t, distance_t, matrix_idx>( \ raft::resources const& handle, \ raft::host_matrix_view<const data_t, matrix_idx, row_major> dataset, \ raft::host_matrix_view<const data_t, matrix_idx, row_major> queries, \ raft::host_matrix_view<const idx_t, matrix_idx, row_major> neighbor_candidates, \ raft::host_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::host_matrix_view<distance_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric); instantiate_raft_neighbors_refine(int64_t, int8_t, float, int64_t); #undef instantiate_raft_neighbors_refine
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/brute_force_fused_l2_knn_float_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by brute_force_00_generate.py * * Make changes there and run in this directory: * * > python brute_force_00_generate.py * */ #include <cstdint> #include <raft/neighbors/brute_force-inl.cuh> #define instantiate_raft_neighbors_brute_force_fused_l2_knn( \ value_t, idx_t, idx_layout, query_layout) \ template void raft::neighbors::brute_force::fused_l2_knn( \ raft::resources const& handle, \ raft::device_matrix_view<const value_t, idx_t, idx_layout> index, \ raft::device_matrix_view<const value_t, idx_t, query_layout> query, \ raft::device_matrix_view<idx_t, idx_t, row_major> out_inds, \ raft::device_matrix_view<value_t, idx_t, row_major> out_dists, \ raft::distance::DistanceType metric); instantiate_raft_neighbors_brute_force_fused_l2_knn(float, int64_t, raft::row_major, raft::row_major); #undef instantiate_raft_neighbors_brute_force_fused_l2_knn
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivfpq_build_int8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq-inl.cuh> #include <raft/neighbors/ivf_pq_types.hpp> // raft::neighbors::ivf_pq::index #define instantiate_raft_neighbors_ivf_pq_build(T, IdxT) \ template raft::neighbors::ivf_pq::index<IdxT> raft::neighbors::ivf_pq::build<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::index_params& params, \ raft::device_matrix_view<const T, IdxT, row_major> dataset); \ \ template auto raft::neighbors::ivf_pq::build( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::index_params& params, \ const T* dataset, \ IdxT n_rows, \ uint32_t dim) \ ->raft::neighbors::ivf_pq::index<IdxT>; instantiate_raft_neighbors_ivf_pq_build(int8_t, int64_t); #undef instantiate_raft_neighbors_ivf_pq_build
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivfpq_search_int8_t_int64_t.cu
/* * Copyright (c) 2022-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq-inl.cuh> #include <raft/neighbors/ivf_pq_types.hpp> // raft::neighbors::ivf_pq::index #define instantiate_raft_neighbors_ivf_pq_search(T, IdxT) \ template void raft::neighbors::ivf_pq::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::search_params& params, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ raft::device_matrix_view<const T, uint32_t, row_major> queries, \ raft::device_matrix_view<IdxT, uint32_t, row_major> neighbors, \ raft::device_matrix_view<float, uint32_t, row_major> distances); \ \ template void raft::neighbors::ivf_pq::search<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::search_params& params, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ const T* queries, \ uint32_t n_queries, \ uint32_t k, \ IdxT* neighbors, \ float* distances, \ rmm::mr::device_memory_resource* mr) instantiate_raft_neighbors_ivf_pq_search(int8_t, int64_t); #undef instantiate_raft_neighbors_ivf_pq_search
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_extend_float_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> #define instantiate_raft_neighbors_ivf_flat_extend(T, IdxT) \ template auto raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index<T, IdxT>& orig_index, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template auto raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \ const raft::neighbors::ivf_flat::index<T, IdxT>& orig_index) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template void raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ raft::neighbors::ivf_flat::index<T, IdxT>* index, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows); \ \ template void raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \ raft::neighbors::ivf_flat::index<T, IdxT>* index); instantiate_raft_neighbors_ivf_flat_extend(float, int64_t); #undef instantiate_raft_neighbors_ivf_flat_extend
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivfpq_extend_uint8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq-inl.cuh> #include <raft/neighbors/ivf_pq_types.hpp> // raft::neighbors::ivf_pq::index #define instantiate_raft_neighbors_ivf_pq_extend(T, IdxT) \ template raft::neighbors::ivf_pq::index<IdxT> raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT, row_major>> new_indices, \ const raft::neighbors::ivf_pq::index<IdxT>& idx); \ \ template void raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT, row_major>> new_indices, \ raft::neighbors::ivf_pq::index<IdxT>* idx); \ \ template auto raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows) \ ->raft::neighbors::ivf_pq::index<IdxT>; \ \ template void raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ raft::neighbors::ivf_pq::index<IdxT>* idx, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows); instantiate_raft_neighbors_ivf_pq_extend(uint8_t, int64_t); #undef instantiate_raft_neighbors_ivf_pq_extend
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivf_flat_extend_int8_t_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_flat_00_generate.py * * Make changes there and run in this directory: * * > python ivf_flat_00_generate.py * */ #include <raft/neighbors/ivf_flat-inl.cuh> #define instantiate_raft_neighbors_ivf_flat_extend(T, IdxT) \ template auto raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_flat::index<T, IdxT>& orig_index, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template auto raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \ const raft::neighbors::ivf_flat::index<T, IdxT>& orig_index) \ ->raft::neighbors::ivf_flat::index<T, IdxT>; \ \ template void raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ raft::neighbors::ivf_flat::index<T, IdxT>* index, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows); \ \ template void raft::neighbors::ivf_flat::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT>> new_indices, \ raft::neighbors::ivf_flat::index<T, IdxT>* index); instantiate_raft_neighbors_ivf_flat_extend(int8_t, int64_t); #undef instantiate_raft_neighbors_ivf_flat_extend
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/brute_force_knn_int64_t_float_uint32_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by brute_force_00_generate.py * * Make changes there and run in this directory: * * > python brute_force_00_generate.py * */ #include <cstdint> #include <raft/neighbors/brute_force-inl.cuh> #define instantiate_raft_neighbors_brute_force_knn( \ idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op) \ template void raft::neighbors::brute_force:: \ knn<idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op>( \ raft::resources const& handle, \ std::vector<raft::device_matrix_view<const value_t, matrix_idx, index_layout>> index, \ raft::device_matrix_view<const value_t, matrix_idx, search_layout> search, \ raft::device_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::device_matrix_view<value_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric, \ std::optional<float> metric_arg, \ std::optional<idx_t> global_id_offset, \ epilogue_op distance_epilogue); instantiate_raft_neighbors_brute_force_knn( int64_t, float, uint32_t, raft::row_major, raft::row_major, raft::identity_op); #undef instantiate_raft_neighbors_brute_force_knn
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/brute_force_knn_int64_t_float_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by brute_force_00_generate.py * * Make changes there and run in this directory: * * > python brute_force_00_generate.py * */ #include <cstdint> #include <raft/neighbors/brute_force-inl.cuh> #define instantiate_raft_neighbors_brute_force_knn( \ idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op) \ template void raft::neighbors::brute_force:: \ knn<idx_t, value_t, matrix_idx, index_layout, search_layout, epilogue_op>( \ raft::resources const& handle, \ std::vector<raft::device_matrix_view<const value_t, matrix_idx, index_layout>> index, \ raft::device_matrix_view<const value_t, matrix_idx, search_layout> search, \ raft::device_matrix_view<idx_t, matrix_idx, row_major> indices, \ raft::device_matrix_view<value_t, matrix_idx, row_major> distances, \ raft::distance::DistanceType metric, \ std::optional<float> metric_arg, \ std::optional<idx_t> global_id_offset, \ epilogue_op distance_epilogue); instantiate_raft_neighbors_brute_force_knn( int64_t, float, int64_t, raft::row_major, raft::row_major, raft::identity_op); #undef instantiate_raft_neighbors_brute_force_knn
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/refine_00_generate.py
# Copyright (c) 2023, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. header = """ /* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by refine_00_generate.py * * Make changes there and run in this directory: * * > python refine_00_generate.py * */ #include <raft/neighbors/refine-inl.cuh> #define instantiate_raft_neighbors_refine(idx_t, data_t, distance_t, matrix_idx) \\ template void raft::neighbors::refine<idx_t, data_t, distance_t, matrix_idx>( \\ raft::resources const& handle, \\ raft::device_matrix_view<const data_t, matrix_idx, row_major> dataset, \\ raft::device_matrix_view<const data_t, matrix_idx, row_major> queries, \\ raft::device_matrix_view<const idx_t, matrix_idx, row_major> neighbor_candidates, \\ raft::device_matrix_view<idx_t, matrix_idx, row_major> indices, \\ raft::device_matrix_view<distance_t, matrix_idx, row_major> distances, \\ raft::distance::DistanceType metric); \\ \\ template void raft::neighbors::refine<idx_t, data_t, distance_t, matrix_idx>( \\ raft::resources const& handle, \\ raft::host_matrix_view<const data_t, matrix_idx, row_major> dataset, \\ raft::host_matrix_view<const data_t, matrix_idx, row_major> queries, \\ raft::host_matrix_view<const idx_t, matrix_idx, row_major> neighbor_candidates, \\ raft::host_matrix_view<idx_t, matrix_idx, row_major> indices, \\ raft::host_matrix_view<distance_t, matrix_idx, row_major> distances, \\ raft::distance::DistanceType metric); """ types = dict( float_float= ("float", "float"), int8_t_float=("int8_t", "float"), uint8_t_float=("uint8_t", "float"), ) for type_path, (data_t, distance_t) in types.items(): path = f"refine_{type_path}.cu" with open(path, "w") as f: f.write(header) f.write(f"instantiate_raft_neighbors_refine(int64_t, {data_t}, {distance_t}, int64_t);\n\n") f.write(f"#undef instantiate_raft_neighbors_refine\n") # for pasting into CMakeLists.txt print(f"src/neighbors/{path}")
0
rapidsai_public_repos/raft/cpp/src
rapidsai_public_repos/raft/cpp/src/neighbors/ivfpq_extend_float_int64_t.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <raft/neighbors/ivf_pq-inl.cuh> #include <raft/neighbors/ivf_pq_types.hpp> // raft::neighbors::ivf_pq::index #define instantiate_raft_neighbors_ivf_pq_extend(T, IdxT) \ template raft::neighbors::ivf_pq::index<IdxT> raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT, row_major>> new_indices, \ const raft::neighbors::ivf_pq::index<IdxT>& idx); \ \ template void raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ raft::device_matrix_view<const T, IdxT, row_major> new_vectors, \ std::optional<raft::device_vector_view<const IdxT, IdxT, row_major>> new_indices, \ raft::neighbors::ivf_pq::index<IdxT>* idx); \ \ template auto raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ const raft::neighbors::ivf_pq::index<IdxT>& idx, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows) \ ->raft::neighbors::ivf_pq::index<IdxT>; \ \ template void raft::neighbors::ivf_pq::extend<T, IdxT>( \ raft::resources const& handle, \ raft::neighbors::ivf_pq::index<IdxT>* idx, \ const T* new_vectors, \ const IdxT* new_indices, \ IdxT n_rows); instantiate_raft_neighbors_ivf_pq_extend(float, int64_t); #undef instantiate_raft_neighbors_ivf_pq_extend
0
rapidsai_public_repos/raft/cpp/src/neighbors
rapidsai_public_repos/raft/cpp/src/neighbors/detail/ivf_pq_compute_similarity_half_half.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_pq_compute_similarity_00_generate.py * * Make changes there and run in this directory: * * > python ivf_pq_compute_similarity_00_generate.py * */ #include <raft/neighbors/detail/ivf_pq_compute_similarity-inl.cuh> #include <raft/neighbors/detail/ivf_pq_fp_8bit.cuh> #define instantiate_raft_neighbors_ivf_pq_detail_compute_similarity_select( \ OutT, LutT, IvfSampleFilterT) \ template auto \ raft::neighbors::ivf_pq::detail::compute_similarity_select<OutT, LutT, IvfSampleFilterT>( \ const cudaDeviceProp& dev_props, \ bool manage_local_topk, \ int locality_hint, \ double preferred_shmem_carveout, \ uint32_t pq_bits, \ uint32_t pq_dim, \ uint32_t precomp_data_count, \ uint32_t n_queries, \ uint32_t n_probes, \ uint32_t topk) \ ->raft::neighbors::ivf_pq::detail::selected<OutT, LutT, IvfSampleFilterT>; \ \ template void \ raft::neighbors::ivf_pq::detail::compute_similarity_run<OutT, LutT, IvfSampleFilterT>( \ raft::neighbors::ivf_pq::detail::selected<OutT, LutT, IvfSampleFilterT> s, \ rmm::cuda_stream_view stream, \ uint32_t dim, \ uint32_t n_probes, \ uint32_t pq_dim, \ uint32_t n_queries, \ uint32_t queries_offset, \ raft::distance::DistanceType metric, \ raft::neighbors::ivf_pq::codebook_gen codebook_kind, \ uint32_t topk, \ uint32_t max_samples, \ const float* cluster_centers, \ const float* pq_centers, \ const uint8_t* const* pq_dataset, \ const uint32_t* cluster_labels, \ const uint32_t* _chunk_indices, \ const float* queries, \ const uint32_t* index_list, \ float* query_kths, \ IvfSampleFilterT sample_filter, \ LutT* lut_scores, \ OutT* _out_scores, \ uint32_t* _out_indices); #define COMMA , instantiate_raft_neighbors_ivf_pq_detail_compute_similarity_select( half, half, raft::neighbors::filtering::ivf_to_sample_filter< int64_t COMMA raft::neighbors::filtering::none_ivf_sample_filter>); #undef COMMA #undef instantiate_raft_neighbors_ivf_pq_detail_compute_similarity_select
0
rapidsai_public_repos/raft/cpp/src/neighbors
rapidsai_public_repos/raft/cpp/src/neighbors/detail/selection_faiss_uint32_t_half.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by selection_faiss_00_generate.py * * Make changes there and run in this directory: * * > python selection_faiss_00_generate.py * */ #include <cstddef> // size_t #include <cstdint> // uint32_t #include <raft/neighbors/detail/selection_faiss-inl.cuh> #define instantiate_raft_neighbors_detail_select_k(payload_t, key_t) \ template void raft::neighbors::detail::select_k(const key_t* inK, \ const payload_t* inV, \ size_t n_rows, \ size_t n_cols, \ key_t* outK, \ payload_t* outV, \ bool select_min, \ int k, \ cudaStream_t stream) instantiate_raft_neighbors_detail_select_k(uint32_t, half); #undef instantiate_raft_neighbors_detail_select_k
0
rapidsai_public_repos/raft/cpp/src/neighbors
rapidsai_public_repos/raft/cpp/src/neighbors/detail/ivf_pq_compute_similarity_float_half.cu
/* * Copyright (c) 2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * NOTE: this file is generated by ivf_pq_compute_similarity_00_generate.py * * Make changes there and run in this directory: * * > python ivf_pq_compute_similarity_00_generate.py * */ #include <raft/neighbors/detail/ivf_pq_compute_similarity-inl.cuh> #include <raft/neighbors/detail/ivf_pq_fp_8bit.cuh> #define instantiate_raft_neighbors_ivf_pq_detail_compute_similarity_select( \ OutT, LutT, IvfSampleFilterT) \ template auto \ raft::neighbors::ivf_pq::detail::compute_similarity_select<OutT, LutT, IvfSampleFilterT>( \ const cudaDeviceProp& dev_props, \ bool manage_local_topk, \ int locality_hint, \ double preferred_shmem_carveout, \ uint32_t pq_bits, \ uint32_t pq_dim, \ uint32_t precomp_data_count, \ uint32_t n_queries, \ uint32_t n_probes, \ uint32_t topk) \ ->raft::neighbors::ivf_pq::detail::selected<OutT, LutT, IvfSampleFilterT>; \ \ template void \ raft::neighbors::ivf_pq::detail::compute_similarity_run<OutT, LutT, IvfSampleFilterT>( \ raft::neighbors::ivf_pq::detail::selected<OutT, LutT, IvfSampleFilterT> s, \ rmm::cuda_stream_view stream, \ uint32_t dim, \ uint32_t n_probes, \ uint32_t pq_dim, \ uint32_t n_queries, \ uint32_t queries_offset, \ raft::distance::DistanceType metric, \ raft::neighbors::ivf_pq::codebook_gen codebook_kind, \ uint32_t topk, \ uint32_t max_samples, \ const float* cluster_centers, \ const float* pq_centers, \ const uint8_t* const* pq_dataset, \ const uint32_t* cluster_labels, \ const uint32_t* _chunk_indices, \ const float* queries, \ const uint32_t* index_list, \ float* query_kths, \ IvfSampleFilterT sample_filter, \ LutT* lut_scores, \ OutT* _out_scores, \ uint32_t* _out_indices); #define COMMA , instantiate_raft_neighbors_ivf_pq_detail_compute_similarity_select( float, half, raft::neighbors::filtering::ivf_to_sample_filter< int64_t COMMA raft::neighbors::filtering::none_ivf_sample_filter>); #undef COMMA #undef instantiate_raft_neighbors_ivf_pq_detail_compute_similarity_select
0