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

Method fetch

python/mod_cvcuda/operators/OpSIFT.cpp:98–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96 }
97
98 static std::shared_ptr<nvcvpy::ICacheItem> fetch(std::vector<std::shared_ptr<nvcvpy::ICacheItem>> &cache)
99 {
100 std::shared_ptr<nvcvpy::ICacheItem> retItem = cache[0];
101
102 long long int maxPayloadSize = 0;
103
104 for (const auto &item : cache)
105 {
106 const Key &key = static_cast<const Key &>(item.get()->key());
107
108 long long int keyPayloadSize = key.payloadSize();
109
110 if (keyPayloadSize > maxPayloadSize)
111 {
112 maxPayloadSize = keyPayloadSize;
113 retItem = item;
114 }
115 }
116
117 cache.clear();
118
119 nvcvpy::Cache::removeAllNotInUseMatching(retItem.get()->key());
120
121 return retItem;
122 }
123
124private:
125 Key m_key;

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected