From ddf9b27272027e556cfdec24e43f2e24b0dfff06 Mon Sep 17 00:00:00 2001 From: pierre Date: Sat, 6 Apr 2024 14:21:03 +0800 Subject: [PATCH] fix: use the log2 in lib std explicitly to prevent makefile from linking other log2 func --- icicle/appUtils/msm/msm.cu | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/icicle/appUtils/msm/msm.cu b/icicle/appUtils/msm/msm.cu index f4b14afcd..21a002eeb 100644 --- a/icicle/appUtils/msm/msm.cu +++ b/icicle/appUtils/msm/msm.cu @@ -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 __global__ void normalize_kernel(E* inout, E factor, int n) @@ -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; @@ -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); @@ -987,4 +987,4 @@ namespace msm { #endif -} // namespace msm \ No newline at end of file +} // namespace msm