Skip to content

Commit

Permalink
use min/max again
Browse files Browse the repository at this point in the history
  • Loading branch information
pmattione-nvidia committed Jan 24, 2025
1 parent dcc11c2 commit 1164256
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/io/parquet/page_string_utils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ __device__ inline int calc_threads_per_string_log2(int avg_string_length) // re
// So, clamp #-threads-per-string M = T / N between: T (all) & T/32 (cache miss)
// So, clamp log2(#-threads-per-string) between log2(T) & log2(T) - 5 (min 1)
static constexpr int block_size_log2 = log2_int<block_size>(); // 7 for block_size = 128
static constexpr int min_threads_log2 = block_size_log2 > 5 ? block_size_log2 - 5 : 1;
static constexpr int min_threads_log2 = cuda::std::max(block_size_log2 - 5, 1);

// Clamp log2(M) (between 2 and 7 for block_size = 128)
return cuda::std::max(min_threads_log2, cuda::std::min(block_size_log2, threads_log2));
Expand Down

0 comments on commit 1164256

Please sign in to comment.