Skip to content

Commit

Permalink
more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvank committed Dec 19, 2019
1 parent cf01b0c commit 082cfb1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gpu/multiexp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ fn calc_window_size(n: usize, exp_bits: usize, core_count: usize) -> usize {
fn calc_best_chunk_size(max_window_size: usize, core_count: usize, exp_bits: usize) -> usize {
// Best chunk-size (N) can also be calculated using the same logic as calc_window_size:
// n = e^window_size * window_size * 2 * core_count / exp_bits
((max_window_size as f64).exp() as usize) * max_window_size * 2 * core_count / exp_bits
(((max_window_size as f64).exp() as f64)
* (max_window_size as f64)
* 2f64
* (core_count as f64)
/ (exp_bits as f64))
.ceil() as usize
}

fn calc_chunk_size<E>(mem: u64, core_count: usize) -> usize
Expand Down

0 comments on commit 082cfb1

Please sign in to comment.