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

Method ResizeArray

python/mod_cvcuda/nvcv/Array.cpp:141–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141std::shared_ptr<Array> Array::ResizeArray(Array &array, int64_t length)
142{
143 Array::Key key;
144 Cache::Instance().removeAllNotInUseMatching(key);
145
146 auto array_impl = array.impl();
147 array_impl.resize(length);
148
149 auto new_array = std::shared_ptr<Array>(new Array(std::move(array_impl)));
150
151 // Need to add wrappers to cache so that they don't get destroyed by
152 // the cuda stream when they're last used, and python script isn't
153 // holding a reference to them. If we don't do it, things might break.
154 Cache::Instance().add(*new_array);
155 return new_array;
156}
157
158std::shared_ptr<Array> Array::ResizeArray(Array &array, Shape shape)
159{

Callers

nothing calls this directly

Calls 5

LengthIf1DFunction · 0.85
implMethod · 0.80
resizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected