| 1742 | } |
| 1743 | |
| 1744 | void SetOp(const string& key, T* op) { |
| 1745 | #ifdef DNNL_AARCH64_USE_ACL |
| 1746 | mutex_lock lock(lru_mu_); |
| 1747 | #endif |
| 1748 | if (lru_list_.size() >= capacity_) { |
| 1749 | Delete(); |
| 1750 | } |
| 1751 | |
| 1752 | // Insert an entry to the front of the LRU list |
| 1753 | lru_list_.push_front(key); |
| 1754 | Entry entry(op, lru_list_.begin()); |
| 1755 | cache_.emplace(std::make_pair(key, std::move(entry))); |
| 1756 | #ifdef DNNL_AARCH64_USE_ACL |
| 1757 | FinishedAllocation(key); |
| 1758 | #endif |
| 1759 | } |
| 1760 | |
| 1761 | void Clear() { |
| 1762 | if (lru_list_.empty()) return; |