MCPcopy Create free account
hub / github.com/apache/arrow / WrapStream

Method WrapStream

cpp/src/arrow/gpu/cuda_context.cc:292–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292Result<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
304Result<std::shared_ptr<CudaDevice>> AsCudaDevice(const std::shared_ptr<Device>& device) {
305 if (IsCudaDevice(*device)) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected