mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-23 01:59:38 +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(
|
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int numThreads(
|
||||||
double output_size, const TensorOpCost& cost_per_coeff, int max_threads) {
|
double output_size, const TensorOpCost& cost_per_coeff, int max_threads) {
|
||||||
double cost = totalCost(output_size, cost_per_coeff);
|
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.
|
// Make sure we don't invoke undefined behavior when we convert to an int.
|
||||||
threads = numext::mini<double>(threads, GenericNumTraits<int>::highest());
|
threads = numext::mini<double>(threads, GenericNumTraits<int>::highest());
|
||||||
return numext::mini(max_threads, numext::maxi<int>(1, threads));
|
return numext::mini(max_threads, numext::maxi<int>(1, threads));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user