| 91 | class AutoTuneMap { |
| 92 | public: |
| 93 | bool Find(const Parameters& params, Config* config) const { |
| 94 | mutex_lock lock(mu_); |
| 95 | auto iter = params_config_map_.find(params); |
| 96 | if (iter == params_config_map_.end() || |
| 97 | (iter->second.score < min_score_threshold_ && |
| 98 | iter->second.count <= max_autotune_count_)) { |
| 99 | return false; |
| 100 | } |
| 101 | *config = iter->second.config; |
| 102 | return true; |
| 103 | } |
| 104 | void Insert(const Parameters& params, const Config& config) { |
| 105 | mutex_lock lock(mu_); |
| 106 | auto iter = params_config_map_.find(params); |