Skip to content

Commit

Permalink
Fix build and pre-filtering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lowener committed Sep 26, 2023
1 parent 4ab04c2 commit 02eebe5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
18 changes: 18 additions & 0 deletions cpp/include/raft/neighbors/detail/cagra/cagra_search.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@

namespace raft::neighbors::cagra::detail {

// A helper function to set a query id offset
template <class CagraSampleFilterT>
inline typename raft::neighbors::filtering::CagraSampleFilterT_Selector<CagraSampleFilterT>::type
set_offset(CagraSampleFilterT filter, const uint32_t offset)
{
typename raft::neighbors::filtering::CagraSampleFilterT_Selector<CagraSampleFilterT>::type
new_filter(offset, filter);
return new_filter;
}
template <>
inline typename raft::neighbors::filtering::CagraSampleFilterT_Selector<
raft::neighbors::filtering::none_cagra_sample_filter>::type
set_offset<raft::neighbors::filtering::none_cagra_sample_filter>(
raft::neighbors::filtering::none_cagra_sample_filter filter, const uint32_t)
{
return filter;
}

/**
* @brief Search ANN using the constructed index.
*
Expand Down
19 changes: 1 addition & 18 deletions cpp/include/raft/neighbors/sample_filter_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct CagraSampleFilterWithQueryIdOffset {
}
};

/** Utility to add an offset to the query ud */
/** Utility to add an offset to the query id */
template <class CagraSampleFilterT>
struct CagraSampleFilterT_Selector {
using type = CagraSampleFilterWithQueryIdOffset<CagraSampleFilterT>;
Expand All @@ -99,23 +99,6 @@ struct CagraSampleFilterT_Selector<raft::neighbors::filtering::none_cagra_sample
using type = raft::neighbors::filtering::none_cagra_sample_filter;
};

// A helper function to set a query id offset
template <class CagraSampleFilterT>
inline typename CagraSampleFilterT_Selector<CagraSampleFilterT>::type set_offset(
CagraSampleFilterT filter, const uint32_t offset)
{
typename CagraSampleFilterT_Selector<CagraSampleFilterT>::type new_filter(offset, filter);
return new_filter;
}
template <>
inline
typename CagraSampleFilterT_Selector<raft::neighbors::filtering::none_cagra_sample_filter>::type
set_offset<raft::neighbors::filtering::none_cagra_sample_filter>(
raft::neighbors::filtering::none_cagra_sample_filter filter, const uint32_t)
{
return filter;
}

using removed_cagra_filter_with_offset_u32 =
CagraSampleFilterWithQueryIdOffset<removed_cagra_filter<uint32_t>>;
using removed_cagra_filter_with_offset_u64 =
Expand Down

0 comments on commit 02eebe5

Please sign in to comment.