Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tfeher committed May 1, 2023
1 parent 4e8cb20 commit 67eb2ef
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions cpp/include/raft/neighbors/detail/cagra/search_multi_cta.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ struct search : public search_plan_impl<DATA_T, INDEX_T, DISTANCE_T> {
void operator()(raft::device_resources const& res,
raft::device_matrix_view<const DATA_T, INDEX_T, row_major> dataset,
raft::device_matrix_view<const INDEX_T, INDEX_T, row_major> graph,
INDEX_T* const topk_indices_ptr, // [num_queries, topk]
DISTANCE_T* const topk_distances_ptr, // [num_queries, topk]
const DATA_T* const queries_ptr, // [num_queries, dataset_dim]
INDEX_T* const topk_indices_ptr, // [num_queries, topk]
DISTANCE_T* const topk_distances_ptr, // [num_queries, topk]
const DATA_T* const queries_ptr, // [num_queries, dataset_dim]
const uint32_t num_queries,
const INDEX_T* dev_seed_ptr, // [num_queries, num_seeds]
uint32_t* const num_executed_iterations, // [num_queries,]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace multi_cta_search {
template <class INDEX_T>
__device__ void pickup_next_parents(INDEX_T* const next_parent_indices, // [num_parents]
const uint32_t num_parents,
INDEX_T* const itopk_indices, // [num_itopk]
INDEX_T* const itopk_indices, // [num_itopk]
const size_t num_itopk,
uint32_t* const terminate_flag)
{
Expand Down Expand Up @@ -81,8 +81,8 @@ __device__ void pickup_next_parents(INDEX_T* const next_parent_indices, // [num
}

template <unsigned MAX_ELEMENTS>
__device__ inline void topk_by_bitonic_sort(float* distances, // [num_elements]
uint32_t* indices, // [num_elements]
__device__ inline void topk_by_bitonic_sort(float* distances, // [num_elements]
uint32_t* indices, // [num_elements]
const uint32_t num_elements,
const uint32_t num_itopk // num_itopk <= num_elements
)
Expand Down Expand Up @@ -138,7 +138,7 @@ __launch_bounds__(BLOCK_SIZE, BLOCK_COUNT) __global__ void search_kernel(
const uint32_t graph_degree,
const unsigned num_distilation,
const uint64_t rand_xor_mask,
const INDEX_T* seed_ptr, // [num_queries, num_seeds]
const INDEX_T* seed_ptr, // [num_queries, num_seeds]
const uint32_t num_seeds,
uint32_t* const visited_hashmap_ptr, // [num_queries, 1 << hash_bitlen]
const uint32_t hash_bitlen,
Expand Down
6 changes: 3 additions & 3 deletions cpp/include/raft/neighbors/detail/cagra/search_single_cta.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@ struct search : search_plan_impl<DATA_T, INDEX_T, DISTANCE_T> {
void operator()(raft::device_resources const& res,
raft::device_matrix_view<const DATA_T, INDEX_T, row_major> dataset,
raft::device_matrix_view<const INDEX_T, INDEX_T, row_major> graph,
INDEX_T* const result_indices_ptr, // [num_queries, topk]
DISTANCE_T* const result_distances_ptr, // [num_queries, topk]
const DATA_T* const queries_ptr, // [num_queries, dataset_dim]
INDEX_T* const result_indices_ptr, // [num_queries, topk]
DISTANCE_T* const result_distances_ptr, // [num_queries, topk]
const DATA_T* const queries_ptr, // [num_queries, dataset_dim]
const std::uint32_t num_queries,
const INDEX_T* dev_seed_ptr, // [num_queries, num_seeds]
std::uint32_t* const num_executed_iterations, // [num_queries]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ __device__ inline void topk_by_bitonic_sort_1st(

template <unsigned MAX_ITOPK, unsigned MULTI_WARPS = 0>
__device__ inline void topk_by_bitonic_sort_2nd(
float* itopk_distances, // [num_itopk]
std::uint32_t* itopk_indices, // [num_itopk]
float* itopk_distances, // [num_itopk]
std::uint32_t* itopk_indices, // [num_itopk]
const std::uint32_t num_itopk,
float* candidate_distances, // [num_candidates]
std::uint32_t* candidate_indices, // [num_candidates]
Expand Down Expand Up @@ -397,8 +397,8 @@ template <unsigned MAX_ITOPK,
unsigned MAX_CANDIDATES,
unsigned MULTI_WARPS_1,
unsigned MULTI_WARPS_2>
__device__ void topk_by_bitonic_sort(float* itopk_distances, // [num_itopk]
std::uint32_t* itopk_indices, // [num_itopk]
__device__ void topk_by_bitonic_sort(float* itopk_distances, // [num_itopk]
std::uint32_t* itopk_indices, // [num_itopk]
const std::uint32_t num_itopk,
float* candidate_distances, // [num_candidates]
std::uint32_t* candidate_indices, // [num_candidates]
Expand Down Expand Up @@ -459,15 +459,15 @@ __launch_bounds__(BLOCK_SIZE, BLOCK_COUNT) __global__
void search_kernel(INDEX_T* const result_indices_ptr, // [num_queries, top_k]
DISTANCE_T* const result_distances_ptr, // [num_queries, top_k]
const std::uint32_t top_k,
const DATA_T* const dataset_ptr, // [dataset_size, dataset_dim]
const DATA_T* const dataset_ptr, // [dataset_size, dataset_dim]
const std::size_t dataset_dim,
const std::size_t dataset_size,
const DATA_T* const queries_ptr, // [num_queries, dataset_dim]
const INDEX_T* const knn_graph, // [dataset_size, graph_degree]
const std::uint32_t graph_degree,
const unsigned num_distilation,
const uint64_t rand_xor_mask,
const INDEX_T* seed_ptr, // [num_queries, num_seeds]
const INDEX_T* seed_ptr, // [num_queries, num_seeds]
const uint32_t num_seeds,
std::uint32_t* const visited_hashmap_ptr, // [num_queries, 1 << hash_bitlen]
const std::uint32_t internal_topk,
Expand Down
3 changes: 1 addition & 2 deletions cpp/include/raft/neighbors/detail/cagra/topk_by_radix.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct topk_by_radix_sort_base {
static constexpr std::uint32_t vecLen = 2; // TODO
};
template <unsigned MAX_INTERNAL_TOPK, unsigned BLOCK_SIZE, class = void>
struct topk_by_radix_sort : topk_by_radix_sort_base<MAX_INTERNAL_TOPK> {
};
struct topk_by_radix_sort : topk_by_radix_sort_base<MAX_INTERNAL_TOPK> {};

template <unsigned MAX_INTERNAL_TOPK, unsigned BLOCK_SIZE>
struct topk_by_radix_sort<MAX_INTERNAL_TOPK,
Expand Down

0 comments on commit 67eb2ef

Please sign in to comment.