| 139 | } |
| 140 | |
| 141 | std::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 | |
| 158 | std::shared_ptr<Array> Array::ResizeArray(Array &array, Shape shape) |
| 159 | { |
nothing calls this directly
no test coverage detected