Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation error when _CLK_BREAKDOWN is defined in cagra. #2350

Merged
merged 4 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <memory>
#include <numeric>
Expand Down Expand Up @@ -209,7 +210,7 @@ __launch_bounds__(1024, 1) RAFT_KERNEL search_kernel(

#if 0
/* debug */
for (unsigned i = threadIdx.x; i < result_buffer_size_32; i += BLOCK_SIZE) {
for (unsigned i = threadIdx.x; i < result_buffer_size_32; i += blockDim.x) {
result_indices_buffer[i] = utils::get_max_value<INDEX_T>();
result_distances_buffer[i] = utils::get_max_value<DISTANCE_T>();
}
Expand Down Expand Up @@ -351,16 +352,19 @@ __launch_bounds__(1024, 1) RAFT_KERNEL search_kernel(
}

#ifdef _CLK_BREAKDOWN
if ((threadIdx.x == 0 || threadIdx.x == BLOCK_SIZE - 1) && (blockIdx.x == 0) &&
if ((threadIdx.x == 0 || threadIdx.x == blockDim.x - 1) && (blockIdx.x == 0) &&
((query_id * 3) % gridDim.y < 3)) {
RAFT_LOG_DEBUG(
printf(
"%s:%d "
"query, %d, thread, %d"
", init, %d"
", init, %lu"
", 1st_distance, %lu"
", topk, %lu"
", pickup_parents, %lu"
", distance, %lu"
"\n",
__FILE__,
__LINE__,
query_id,
threadIdx.x,
clk_init,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <memory>
#include <numeric>
Expand Down Expand Up @@ -448,14 +449,6 @@ __device__ inline void hashmap_restore(INDEX_T* const hashmap_ptr,
}
}

template <class T, unsigned BLOCK_SIZE>
__device__ inline void set_value_device(T* const ptr, const T fill, const std::uint32_t count)
{
for (std::uint32_t i = threadIdx.x; i < count; i += BLOCK_SIZE) {
ptr[i] = fill;
}
}

// One query one thread block
template <uint32_t TEAM_SIZE,
uint32_t DATASET_BLOCK_DIM,
Expand Down Expand Up @@ -791,17 +784,20 @@ __launch_bounds__(1024, 1) RAFT_KERNEL search_kernel(
num_executed_iterations[query_id] = iter + 1;
}
#ifdef _CLK_BREAKDOWN
if ((threadIdx.x == 0 || threadIdx.x == BLOCK_SIZE - 1) && ((query_id * 3) % gridDim.y < 3)) {
RAFT_LOG_DEBUG(
if ((threadIdx.x == 0 || threadIdx.x == blockDim.x - 1) && ((query_id * 3) % gridDim.y < 3)) {
printf(
"%s:%d "
"query, %d, thread, %d"
", init, %d"
", init, %lu"
", 1st_distance, %lu"
", topk, %lu"
", reset_hash, %lu"
", pickup_parents, %lu"
", restore_hash, %lu"
", distance, %lu"
"\n",
__FILE__,
__LINE__,
query_id,
threadIdx.x,
clk_init,
Expand Down
Loading