mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 17:49:36 +08:00
Fix cut-and-paste error.
This commit is contained in:
parent
94e2213b38
commit
1b7294f6fc
@ -174,6 +174,7 @@ class TensorCostModel {
|
||||
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int numThreads(
|
||||
double output_size, const TensorOpCost& cost_per_coeff, int max_threads) {
|
||||
double cost = totalCost(output_size, cost_per_coeff);
|
||||
double threads = (cost - kStartupCycles) / kPerThreadCycles + 0.9;
|
||||
// Make sure we don't invoke undefined behavior when we convert to an int.
|
||||
threads = numext::mini<double>(threads, GenericNumTraits<int>::highest());
|
||||
return numext::mini(max_threads, numext::maxi<int>(1, threads));
|
||||
|
Loading…
x
Reference in New Issue
Block a user