MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / fetch

Method fetch

python/mod_cvcuda/operators/OpInpaint.cpp:88–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86 }
87
88 static std::shared_ptr<nvcvpy::ICacheItem> fetch(std::vector<std::shared_ptr<nvcvpy::ICacheItem>> &cache)
89 {
90 assert(!cache.empty());
91
92 std::shared_ptr<nvcvpy::ICacheItem> retItem = cache[0];
93 size_t maxPayloadSize = 0;
94
95 for (const auto &item : cache)
96 {
97 const Key &key = static_cast<const Key &>(item.get()->key());
98 size_t keyPayloadSize = key.payloadSize();
99
100 if (keyPayloadSize > maxPayloadSize)
101 {
102 maxPayloadSize = keyPayloadSize;
103 retItem = item;
104 }
105 }
106
107 cache.clear();
108
109 nvcvpy::Cache::removeAllNotInUseMatching(retItem.get()->key());
110
111 return retItem;
112 }
113
114private:
115 Key m_key;

Callers

nothing calls this directly

Calls 5

emptyMethod · 0.45
keyMethod · 0.45
getMethod · 0.45
payloadSizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected