| 139 | } |
| 140 | |
| 141 | void InMemoryPersistentCache::put( |
| 142 | const std::string& category, const Blob& key, const Blob& value) { |
| 143 | BlobStorage key_storage; |
| 144 | key_storage.init_data_ref(key).init_hash(); |
| 145 | |
| 146 | MGB_LOCK_GUARD(m_mtx); |
| 147 | auto size0 = m_cache.size(); |
| 148 | m_cache[category][std::move(key_storage)].init_data_ref(value); |
| 149 | if (m_cache.size() > size0) { |
| 150 | mgb_log_debug("new cache category: %s", category.c_str()); |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | // ================= AlgoChooserProfileCache ================== |
| 155 | AlgoChooserProfileCache::AlgoChooserProfileCache(CompNode cn, const char* opr_type) { |