| 290 | } |
| 291 | |
| 292 | Result<std::shared_ptr<Device::Stream>> CudaDevice::WrapStream( |
| 293 | void* stream, Device::Stream::release_fn_t release_fn) { |
| 294 | if (!release_fn) { |
| 295 | release_fn = [](void*) {}; |
| 296 | } |
| 297 | |
| 298 | auto cu_stream = reinterpret_cast<CUstream*>(stream); |
| 299 | ARROW_ASSIGN_OR_RAISE(auto context, GetContext()); |
| 300 | return std::shared_ptr<Device::Stream>( |
| 301 | new CudaDevice::Stream(context, cu_stream, release_fn)); |
| 302 | } |
| 303 | |
| 304 | Result<std::shared_ptr<CudaDevice>> AsCudaDevice(const std::shared_ptr<Device>& device) { |
| 305 | if (IsCudaDevice(*device)) { |
nothing calls this directly
no outgoing calls
no test coverage detected