mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-08 09:49:03 +08:00
fix Wshorten-64-to-32 warnings in div_ceil
This commit is contained in:
parent
1aac9332ce
commit
6f9ad7da61
@ -1548,10 +1548,10 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
|
|||||||
Index nn0 = numext::div_ceil(n, bn);
|
Index nn0 = numext::div_ceil(n, bn);
|
||||||
Index new_tasks = numext::div_ceil(nm0, gm) * numext::div_ceil(nn0, gn);
|
Index new_tasks = numext::div_ceil(nm0, gm) * numext::div_ceil(nn0, gn);
|
||||||
double new_parallelism = static_cast<double>(new_tasks) /
|
double new_parallelism = static_cast<double>(new_tasks) /
|
||||||
(numext::div_ceil<int>(new_tasks, num_threads) * num_threads);
|
(numext::div_ceil<Index>(new_tasks, num_threads) * num_threads);
|
||||||
Index old_tasks = numext::div_ceil(nm0, oldgm) * numext::div_ceil(nn0, oldgn);
|
Index old_tasks = numext::div_ceil(nm0, oldgm) * numext::div_ceil(nn0, oldgn);
|
||||||
double old_parallelism = static_cast<double>(old_tasks) /
|
double old_parallelism = static_cast<double>(old_tasks) /
|
||||||
(numext::div_ceil<int>(old_tasks, num_threads) * num_threads);
|
(numext::div_ceil<Index>(old_tasks, num_threads) * num_threads);
|
||||||
if (new_parallelism > old_parallelism || new_parallelism == 1) return 1;
|
if (new_parallelism > old_parallelism || new_parallelism == 1) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -373,7 +373,7 @@ struct ThreadPoolDevice {
|
|||||||
// computations:
|
// computations:
|
||||||
double max_efficiency =
|
double max_efficiency =
|
||||||
static_cast<double>(block_count) /
|
static_cast<double>(block_count) /
|
||||||
(numext::div_ceil<int>(block_count, numThreads()) * numThreads());
|
(numext::div_ceil<Index>(block_count, numThreads()) * numThreads());
|
||||||
|
|
||||||
// Now try to increase block size up to max_block_size as long as it
|
// Now try to increase block size up to max_block_size as long as it
|
||||||
// doesn't decrease parallel efficiency.
|
// doesn't decrease parallel efficiency.
|
||||||
@ -396,7 +396,7 @@ struct ThreadPoolDevice {
|
|||||||
prev_block_count = coarser_block_count;
|
prev_block_count = coarser_block_count;
|
||||||
const double coarser_efficiency =
|
const double coarser_efficiency =
|
||||||
static_cast<double>(coarser_block_count) /
|
static_cast<double>(coarser_block_count) /
|
||||||
(numext::div_ceil<int>(coarser_block_count, numThreads()) * numThreads());
|
(numext::div_ceil<Index>(coarser_block_count, numThreads()) * numThreads());
|
||||||
if (coarser_efficiency + 0.01 >= max_efficiency) {
|
if (coarser_efficiency + 0.01 >= max_efficiency) {
|
||||||
// Taking it.
|
// Taking it.
|
||||||
block_size = coarser_block_size;
|
block_size = coarser_block_size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user