Skip to content

Commit

Permalink
fix: use the log2 in lib std explicitly to prevent makefile from link…
Browse files Browse the repository at this point in the history
…ing other log2 func
  • Loading branch information
pierre committed Apr 6, 2024
1 parent 9c9311b commit ddf9b27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions icicle/appUtils/msm/msm.cu
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace msm {
points_out[tid] = P::to_affine(point);
}

unsigned get_optimal_c(int bitsize) { return max((unsigned)ceil(log2(bitsize)) - 4, 1U); }
unsigned get_optimal_c(int bitsize) { return max((unsigned)ceil(std::log2(bitsize)) - 4, 1U); }

template <typename E>
__global__ void normalize_kernel(E* inout, E factor, int n)
Expand Down Expand Up @@ -418,7 +418,7 @@ namespace msm {
unsigned nof_bms_per_msm = (total_bms_per_msm - 1) / precompute_factor + 1;
unsigned input_indexes_count = nof_scalars * total_bms_per_msm;

unsigned bm_bitsize = (unsigned)ceil(log2(nof_bms_per_msm));
unsigned bm_bitsize = (unsigned)ceil(std::log2(nof_bms_per_msm));

unsigned* bucket_indices;
unsigned* point_indices;
Expand Down Expand Up @@ -650,7 +650,7 @@ namespace msm {
// buckets
unsigned large_buckets_nof_threads =
(h_nof_pts_in_large_buckets + average_bucket_size - 1) / average_bucket_size + h_nof_large_buckets;
unsigned log_nof_large_buckets = (unsigned)ceil(log2(h_nof_large_buckets));
unsigned log_nof_large_buckets = (unsigned)ceil(std::log2(h_nof_large_buckets));
unsigned* large_bucket_indices;
CHK_IF_RETURN(cudaMallocAsync(&large_bucket_indices, sizeof(unsigned) * large_buckets_nof_threads, stream));
NUM_THREADS = min(1 << 8, h_nof_large_buckets);
Expand Down Expand Up @@ -987,4 +987,4 @@ namespace msm {

#endif

} // namespace msm
} // namespace msm

0 comments on commit ddf9b27

Please sign in to comment.