Skip to content

Commit

Permalink
add new headers to CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
tarang-jain committed Nov 12, 2024
1 parent 205f84b commit 7d16801
Show file tree
Hide file tree
Showing 69 changed files with 1,351 additions and 359 deletions.
24 changes: 24 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,30 @@ if(BUILD_SHARED_LIBS)
src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_uint8_uint32_dim128_t8.cu
src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_uint8_uint32_dim256_t16.cu
src/neighbors/detail/cagra/compute_distance_standard_L2Expanded_uint8_uint32_dim512_t32.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_float_uint32_dim128_t8_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_float_uint32_dim128_t8_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_float_uint32_dim256_t16_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_float_uint32_dim256_t16_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_float_uint32_dim512_t32_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_float_uint32_dim512_t32_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_half_uint32_dim128_t8_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_half_uint32_dim128_t8_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_half_uint32_dim256_t16_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_half_uint32_dim256_t16_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_half_uint32_dim512_t32_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_half_uint32_dim512_t32_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_int8_uint32_dim128_t8_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_int8_uint32_dim128_t8_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_int8_uint32_dim256_t16_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_int8_uint32_dim256_t16_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_int8_uint32_dim512_t32_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_int8_uint32_dim512_t32_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_uint8_uint32_dim128_t8_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_uint8_uint32_dim128_t8_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_uint8_uint32_dim256_t16_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_uint8_uint32_dim256_t16_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_uint8_uint32_dim512_t32_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_InnerProduct_uint8_uint32_dim512_t32_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim128_t8_8pq_2subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim128_t8_8pq_4subd_half.cu
src/neighbors/detail/cagra/compute_distance_vpq_L2Expanded_float_uint32_dim256_t16_8pq_2subd_half.cu
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/neighbors/detail/cagra/cagra_build.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ index<T, IdxT> build(
"VPQ compression is only supported with L2Expanded and InnerProduct distance mertric");
index<T, IdxT> idx(res, params.metric);
idx.update_graph(res, raft::make_const_mdspan(cagra_graph.view()));
auto compression_params = *params.compression;
auto compression_params = *params.compression;
compression_params.metric = params.metric;
idx.update_dataset(
res,
Expand Down
944 changes: 724 additions & 220 deletions cpp/src/neighbors/detail/cagra/compute_distance-ext.cuh

Large diffs are not rendered by default.

146 changes: 73 additions & 73 deletions cpp/src/neighbors/detail/cagra/compute_distance.cu
Original file line number Diff line number Diff line change
Expand Up @@ -29,78 +29,78 @@ namespace cuvs::neighbors::cagra::detail {

using namespace cuvs::distance;

template struct instance_selector<standard_descriptor_spec<DistanceType::L2Expanded, 8, 128, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 8, 128, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 4, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 4, half, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 16, 256, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 16, 256, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 4, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 4, half, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 32, 512, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 32, 512, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 4, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 4, half, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 8, 128, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 8, 128, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 4, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 4, half, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 16, 256, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 16, 256, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 4, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 4, half, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 32, 512, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 32, 512, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 4, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 4, half, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 8, 128, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 8, 128, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 4, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 4, half, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 16, 256, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 16, 256, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 4, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 4, half, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 32, 512, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 32, 512, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 4, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 4, half, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 8, 128, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 8, 128, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 4, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 4, half, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 16, 256, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 16, 256, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 4, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 4, half, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 32, 512, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 32, 512, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 4, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 4, half, uint8_t, uint32_t, float>>;

template struct instance_selector<
standard_descriptor_spec<DistanceType::L2Expanded, 8, 128, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 8, 128, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 4, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 4, half, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 16, 256, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 16, 256, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 4, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 4, half, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 32, 512, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 32, 512, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 2, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 4, half, float, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 4, half, float, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 8, 128, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 8, 128, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 4, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 4, half, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 16, 256, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 16, 256, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 4, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 4, half, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 32, 512, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 32, 512, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 2, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 4, half, half, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 4, half, half, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 8, 128, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 8, 128, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 4, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 4, half, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 16, 256, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 16, 256, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 4, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 4, half, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 32, 512, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 32, 512, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 2, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 4, half, int8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 4, half, int8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 8, 128, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 8, 128, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 8, 128, 8, 4, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 8, 128, 8, 4, half, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 16, 256, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 16, 256, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 16, 256, 8, 4, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 16, 256, 8, 4, half, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::L2Expanded, 32, 512, uint8_t, uint32_t, float>,
standard_descriptor_spec<DistanceType::InnerProduct, 32, 512, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 2, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::L2Expanded, 32, 512, 8, 4, half, uint8_t, uint32_t, float>,
vpq_descriptor_spec<DistanceType::InnerProduct, 32, 512, 8, 4, half, uint8_t, uint32_t, float>>;

} // namespace cuvs::neighbors::cagra::detail
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
namespace cuvs::neighbors::cagra::detail {

using namespace cuvs::distance;
template struct standard_descriptor_spec<DistanceType::InnerProduct, 8, 128, float, uint32_t, float>;
template struct standard_descriptor_spec<DistanceType::InnerProduct,
8,
128,
float,
uint32_t,
float>;

} // namespace cuvs::neighbors::cagra::detail
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
namespace cuvs::neighbors::cagra::detail {

using namespace cuvs::distance;
template struct standard_descriptor_spec<DistanceType::InnerProduct, 16, 256, float, uint32_t, float>;
template struct standard_descriptor_spec<DistanceType::InnerProduct,
16,
256,
float,
uint32_t,
float>;

} // namespace cuvs::neighbors::cagra::detail
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
namespace cuvs::neighbors::cagra::detail {

using namespace cuvs::distance;
template struct standard_descriptor_spec<DistanceType::InnerProduct, 32, 512, float, uint32_t, float>;
template struct standard_descriptor_spec<DistanceType::InnerProduct,
32,
512,
float,
uint32_t,
float>;

} // namespace cuvs::neighbors::cagra::detail
Loading

0 comments on commit 7d16801

Please sign in to comment.