| 139 | */ |
| 140 | template <typename... ObjectConstructorArgs> |
| 141 | ObjectLease Get(int device_id, cudaStream_t stream, ObjectConstructorArgs&&... args) { |
| 142 | std::lock_guard<mutex_type> guard(lock_); |
| 143 | RecycleFinished(); |
| 144 | if (reuse_pending_on_same_stream) { |
| 145 | if (auto ret = GetPending(stream)) |
| 146 | return {this, std::move(ret)}; |
| 147 | } |
| 148 | return {this, |
| 149 | GetFromDevicePool(device_id, stream, std::forward<ObjectConstructorArgs>(args)...)}; |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * @brief Gets an object from the current device's pool or creates one if none are available |
no test coverage detected