Skip to content

Commit

Permalink
use min/max
Browse files Browse the repository at this point in the history
  • Loading branch information
pmattione-nvidia committed Jan 24, 2025
1 parent e3ecae2 commit fd3aed2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cpp/src/io/parquet/page_string_utils.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ __device__ inline int calc_threads_per_string_log2(int avg_string_length) // re
static constexpr int min_threads_log2 = block_size_log2 > 5 ? block_size_log2 - 5 : 1;

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

/**
Expand Down

0 comments on commit fd3aed2

Please sign in to comment.